Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

leading zeroes

Status
Not open for further replies.

spizotfl

MIS
Aug 17, 2005
345
US
hi, i have a query that i need to export data from. i have a column that has values between 0-999. i need for that values to come out as 3 digit values
ie.
0 = 000
1 = 001
10 = 010
100 = 100
how can i make the output format this way?
thanks
 
Select Format(myField, "000") As [myFieldWithZeros], ...
 
that shows well in the query window, but when i export it to a text file, i only have a single zero, not 3...
 
i can't use that save formatted option because i need to have fixed width fields
 
Hi -

Try incorporating the Str() function. Example:

x = 99
y = format(str(x), "000")
? y
099

Bob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top