Export currency fields

  • Thread starter Thread starter Ron
  • Start date Start date
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?
 
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")
 
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?


.
 
Back
Top