I am trying to convert an access table into a fixed length text fi

K

k3639

The problem I am having is that I cannot convert an access numeric field into
a fixed length, right justified, zero filled numeric field. In the case of a
numeric field with 2 defined decimal places, I am unable to tell the
conversion process to drop the decimal indicator while retaining to
characters to the right of the decimal point. Any assistance or suggestions
would be appreciated! Thanks!
 
J

John Vinson

The problem I am having is that I cannot convert an access numeric field into
a fixed length, right justified, zero filled numeric field. In the case of a
numeric field with 2 defined decimal places, I am unable to tell the
conversion process to drop the decimal indicator while retaining to
characters to the right of the decimal point. Any assistance or suggestions
would be appreciated! Thanks!

Use the Format() function to create a calculated field, and import
from that Query with the calculated field rather than exporting from
the table itself. To dispose of the decimal places just multiply by
100 (e.g. Cint(12.365 * 100) = 1236) E.g. put in a vacant Field cell
something like

ExpMyNumber: Format(CInt([MyNumber]*100, "#0"))


John W. Vinson[MVP]
 
K

k3639

John,

I guess I am not very familiar with the query process, I am not sure where I
am to enter the Format() option, and the *100 generates an error message.
Also, this seems to only generate another access table, rather than the
output of a text file, and I cannot right-justify the fields. Could you
assist further, I am new to this process.

Thanks!!!

John Vinson said:
The problem I am having is that I cannot convert an access numeric field into
a fixed length, right justified, zero filled numeric field. In the case of a
numeric field with 2 defined decimal places, I am unable to tell the
conversion process to drop the decimal indicator while retaining to
characters to the right of the decimal point. Any assistance or suggestions
would be appreciated! Thanks!

Use the Format() function to create a calculated field, and import
from that Query with the calculated field rather than exporting from
the table itself. To dispose of the decimal places just multiply by
100 (e.g. Cint(12.365 * 100) = 1236) E.g. put in a vacant Field cell
something like

ExpMyNumber: Format(CInt([MyNumber]*100, "#0"))


John W. Vinson[MVP]
 
D

Douglas J Steele

There's a slight typo in John's formula: a closing parenthesis is missing.
It should be

ExpMyNumber: Format(CInt([MyNumber]*100), "#0"))

It's a query, not a table, but it can be exported the same as a table can.



--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


k3639 said:
John,

I guess I am not very familiar with the query process, I am not sure where I
am to enter the Format() option, and the *100 generates an error message.
Also, this seems to only generate another access table, rather than the
output of a text file, and I cannot right-justify the fields. Could you
assist further, I am new to this process.

Thanks!!!

John Vinson said:
The problem I am having is that I cannot convert an access numeric field into
a fixed length, right justified, zero filled numeric field. In the case of a
numeric field with 2 defined decimal places, I am unable to tell the
conversion process to drop the decimal indicator while retaining to
characters to the right of the decimal point. Any assistance or suggestions
would be appreciated! Thanks!

Use the Format() function to create a calculated field, and import
from that Query with the calculated field rather than exporting from
the table itself. To dispose of the decimal places just multiply by
100 (e.g. Cint(12.365 * 100) = 1236) E.g. put in a vacant Field cell
something like

ExpMyNumber: Format(CInt([MyNumber]*100, "#0"))


John W. Vinson[MVP]
 

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