Data Manipulation

IanT

Registered User.
Local time
Today, 11:57
Joined
Nov 30, 2001
Messages
191
Hi
I have data in a table:
1234
6987
664
663
65
89

Does anyone no how I can update the numbers so they are 5 figures using a 0.

ie:
01234
00664
00065

Thanks in advance!
 
Format them to 00000 in a query.
 
Depends upon what you are trying to do

depends upon what you are trying to do.

although they may look like numbers to you,
are they coming from another source that
stores them with zeroes? if so, and you don't have to perform
mathematics on them, such as the are record numbers, project numbers,
etc, format the field as text, and import or append them with the zeros.

sportsguy
 
To IanT:
Try this iff statement either in your query or report or form
IIf(Len([recnum])=4,"0" & CInt([recnum]),
IIf(Len([recnum])=3,"00" & CInt([recnum]),
IIf(Len([recnum])=2,"000" & CInt([recnum]),
IIf(Len([recnum])=1,"0000" & CInt([recnum]),[recnum]))))
the field [recnum] can be changed to your field name.
this will convert your number field to a text field and
place the appropiate zero in the front, if you need
further assistance with this issue feel free to contact me
my web site and in the upper right corner click on Live Chat, advice is free.
Hope this helps, Flixx.
 
data manipulation

I tried to do your suggestion in an update query and it didn't work. but when I give it a dummy variable it does work in a simple query. Would you know what it doesn't work?
 

Users who are viewing this thread

Back
Top Bottom