whit ado abd vb6 classic

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

whit ado abd vb6 classic

Post by sal21 »

Have a column in access table with value similar:

879
9876
456
...

The field are formatted text

How to update all value in this column with #0000 and return:

0879
9876
0456
....

???

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

Re: whit ado abd vb6 classic

Post by HansV »

Try this:

UPDATE [TableName] SET [FieldName] = Format([FieldName],"0000");

Substitute the appropriate names.
Best wishes,
Hans

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

Re: whit ado abd vb6 classic

Post by sal21 »

HansV wrote:Try this:

UPDATE [TableName] SET [FieldName] = Format([FieldName],"0000");

Substitute the appropriate names.
Great! tks.