Format Numeric Data For Export

F

fh721

Hi,

I have a problem I'm hoping someone can help me with. I have a
table that needs to be exported as fixed text fields ( that's not the
problem ).

The first thing I'm doing to prepare the table for export is appending
it to an empty table that is basically a duplicate of the original table
except any 'Number' Data Type Fields are changed to text fields and
the field size is set to the proper length. I am then multiplying the
field by 100 to remove the decimal point ( this table is being exported
to a legacy main frame system that assumes the last 2 characters
are decimal positions Ex: a value of 123.45 would have to be in the
format of 12345 in order for the application on the main frame to be
able to use it ).

Now this is where the problem begins, when I export the data to an
ASCII text file the field ( the fixed field size is 8 ) the number 12345
is in the field as “12345 “, what I need to do is shift the number to
the right and then replace the leading spaces with a 0 ex: the value
12345 needs to be 00012345.

Is this possible with a Query? I would need to do this regardless of
how many digits are in the field, 123 would need to be formatted to
00000123, 1234 as 00001234, ect.

Thank you for any help you can give me on this
 

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