max lenght from column in access table...

User avatar
sal21
PlatinumLounger
Posts: 4354
Joined: 26 Apr 2010, 17:36

max lenght from column in access table...

Post by sal21 »

How to calculate from each column in access table (old_table) the max lenght of string value?
Is important to set the max lenght of fileds into the new_table because alla fileds in new_table are text formatted.
I'm sure HansV understand my prob:-)

Note:
HansV i'm very happy to see you on one of my post:-) :clapping:
:sad: remember 4 year old?

User avatar
HansV
Administrator
Posts: 78457
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: max lenght from column in access table...

Post by HansV »

You can create a query

SELECT Max(Len([Field1])) As LenOfField1, Max(Len([Field2])) As LenOfField2, ... FROM [table_old]

This will return the maximum length of each field in table_old.
Best wishes,
Hans

User avatar
sal21
PlatinumLounger
Posts: 4354
Joined: 26 Apr 2010, 17:36

Re: max lenght from column in access table...

Post by sal21 »

HansV wrote:You can create a query

SELECT Max(Len([Field1])) As LenOfField1, Max(Len([Field2])) As LenOfField2, ... FROM [table_old]

This will return the maximum length of each field in table_old.
sorry for delay but i can test tomorrow...
tks in other case