format

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am sending fields from a table to a (text) .txt file.
Although the amount field is in 2 decimal places, the .txt file shows 12.00
as 12 only (for example) How can I format the field so that the dollar value
in the text file shows the 2 decimal places? Help will be appreciated.
(Access 97)
 
Create a Query using the Calculated Field:

FormattedAmount: Format([YourField], "0.00")

(plus other Fields)

and use this Query as the source for your export rather than the Table.
 
If you're using the text export wizard to export the data from a query to a
text file, the number of decimal places that appears in the text file is
controlled through Start -> Settings -> Control Panel -> Regional and
Language Options -> Regional Options. The number format appearing under
"Number" is what Access always uses.

The onyl way I know to force it something else is to convert the number
into a text field and export it without text delimiters... unfortunately,
that could mess with other genuine text fields, but otherwise, I don;t
think you can do anything about it...
 
The onyl way I know to force it something else is to convert the number
into a text field
.... which is easily done using the Format() function, which accepts a
number and returns a string.

John W. Vinson[MVP]
 
... which is easily done using the Format() function, which accepts a
number and returns a string.

I agree that this is easy to do, but then when you export it to a text
file, Access will put the double quotes around the field (because it is
text), which you may not want (depending on what's going to import it on
the other end). You can tell the Export wizard not to put double quotes
around text fields, but then if any of your actual text fields have the
field delimiter in them, it will throw out the column conversion when you
do export. So while it's a good solution in most cases, it might not be so
in every case...
 
I am having a simlar problem. I need to export the results of a query to a
..txt file but I cannot have the double quotes (Result not "Result") that
Access defaults to. Whats the code to just make it comma delimited?
 

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

Similar Threads


Back
Top