Export currency fields

R

Ron

I have a database that exports a table to a fixed width
file. I have a problem with exporting fields that are
currency. The final file cannot have a $ in it. If I
format the field to currency with no dollar sign showing,
the $ sign still shows up in the text file. If I change
the field to a number with two decimal places, it drops
the cents in the field. Does anyone know how to fix this?
 
J

Joe Fallon

If your field is character based and needs to be right justified try:
Field: MyRightText: Right$(Space(10) & MyField,10)

If your field is numeric and needs leading zeroes use a similar technique to
return leading zeroes.
Field: MyRightText: Right$("0000000000" & MyField,10)

For decimal problems:
Create a query with the fields that you want to export and use the Format()
function to specify the number of decimal places in the number field. For
example, if your field has 4 decimal places, the column in the query grid
would look as follows:

Field: Format([MyField],"##0.0000")
 
R

Ron

I couldn't figure out how to format it. But, I did
change the field from Currency to Number and then changed
the type to decimal.
Thanks for your help.
-----Original Message-----
If your field is character based and needs to be right justified try:
Field: MyRightText: Right$(Space(10) & MyField,10)

If your field is numeric and needs leading zeroes use a similar technique to
return leading zeroes.
Field: MyRightText: Right$("0000000000" & MyField,10)

For decimal problems:
Create a query with the fields that you want to export and use the Format()
function to specify the number of decimal places in the number field. For
example, if your field has 4 decimal places, the column in the query grid
would look as follows:

Field: Format([MyField],"##0.0000")

--
Joe Fallon
Access MVP



Ron said:
I have a database that exports a table to a fixed width
file. I have a problem with exporting fields that are
currency. The final file cannot have a $ in it. If I
format the field to currency with no dollar sign showing,
the $ sign still shows up in the text file. If I change
the field to a number with two decimal places, it drops
the cents in the field. Does anyone know how to fix
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