Help on zero field

D

Duyen

Hi. I'm working on converting a data file into a text file format that my
other system reads. The data file of mine contains 5 different numeric fields
but these fields are not zero filed and right justified. How can I zero
field the numeric field that is valid for 14 characters?

Example:
Current Want it to be
1200 00000000001200
21341 00000000021341
Can someone help me with this please?????
 
M

Marshall Barton

Duyen said:
Hi. I'm working on converting a data file into a text file format that my
other system reads. The data file of mine contains 5 different numeric fields
but these fields are not zero filed and right justified. How can I zero
field the numeric field that is valid for 14 characters?

Example:
Current Want it to be
1200 00000000001200
21341 00000000021341


And you are using what to create the text file?

If you are just exporting a table to the text file, then use
a query based on the table instead of just the table. The
query can use the Format function (or other string
functions) to firmat the numbers as needed. E,g,

SELECT Format(number,"00000000000000") As FormattedNum,
other fields, ...
FROM yourtable
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top