Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I export number from 10 to 10.00 in text file.

Status
Not open for further replies.

acin0026

Technical User
Feb 5, 2001
12
TH
Hello,

I have a filed in table which data type is Number, Field size is Double, Format is Fix, Decimal is 2. It shows 10.00 in the table. When, I export this table to text file by module, It shows only 10. How can I export to 10.00

By the way, I can change data type to Currency. However, I do not need Dollar Sign.

thanks.
 
Try converting it to a string before you send it to the text file. ex. CStr(<your value>)
 
Are you exporting from a query window? Here is a sample statement I use a lot:

Current Rate: Format([cur_rate],&quot;0.000&quot;)

This exports the field with three decimal places. Use &quot;0.00&quot; for two decimal places. I hope this helps.
 
Thanks for your comment.

I need to export from table, what should I do?

thanks again.
 
Use preebs' suggestion in a query, make a query that simply selects all of your fields. Convert the one field with the format function and run your export of the query instead of the table.

HTH Joe Miller
joe.miller@flotech.net
 
I don't know of a way to do this directly from the table. Maybe someone else has already figured this out and can help.

Exporting directly from tables is a lot less flexible than working in queries. I tried messing around a lot with the table field formats with no success before I moved to queries which offer a lot more functionality. Plus, I can use VBA to change the table name in the query SQL. This allows me to export the formatted data over and over from different tables, using the same query. Do you really have to export from the table? I can help you build the full query SQL statement if you'd like.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top