Data changes during Export

G

Guest

I am exporting a query that contains two fields with the following data
types "+000000.00" and "000"....both without the quotes.
These datatypes have been formatted in the underlying table, as well as the
properties in the query as +000000.00 and 000.

I want to export them from the query to a text csv format that will be comma
delimited, exp. "001,+000043.00" ...without the quotes.

When I "export" to either a txt/csv or an excel file the data is truncated
too 1,43, from the above example. How do I keep the original format?
 
D

Douglas J. Steele

You need to use the Format function in your query, not the Format property.

In other words, instead of

SELECT Field1, Field2
FROM MyTable

you need

SELECT Format(Field1, "000"),
Format(Field2, "+000000.00)
FROM MyTable
 
G

Guest

Doug,
Thanks for the info and may I ask you to help me format this, since I am new
to working with SQL. Here is what I have:
SELECT [Products_a_Inventory_EXPORT_File Query].ISBN,
[Products_a_Inventory_EXPORT_File Query].[Allow B_O],
[Products_a_Inventory_EXPORT_File Query].End_Inv
FROM [Products_a_Inventory_EXPORT_File Query];

.....and here is the new format you have suggested, but I would appreciate a
little more of your guidance.

SELECT Format(Field1, "000"),
Format(Field2, "+000000.00)
FROM MyTable
 
G

Guest

Doug..
I got it!!!
Thanks for the help!!

MarySue said:
Doug,
Thanks for the info and may I ask you to help me format this, since I am new
to working with SQL. Here is what I have:
SELECT [Products_a_Inventory_EXPORT_File Query].ISBN,
[Products_a_Inventory_EXPORT_File Query].[Allow B_O],
[Products_a_Inventory_EXPORT_File Query].End_Inv
FROM [Products_a_Inventory_EXPORT_File Query];

....and here is the new format you have suggested, but I would appreciate a
little more of your guidance.

SELECT Format(Field1, "000"),
Format(Field2, "+000000.00)
FROM MyTable


Douglas J. Steele said:
You need to use the Format function in your query, not the Format property.

In other words, instead of

SELECT Field1, Field2
FROM MyTable

you need

SELECT Format(Field1, "000"),
Format(Field2, "+000000.00)
FROM MyTable
 

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