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!

Formating changes when exporting

Status
Not open for further replies.

bravo6

IS-IT--Management
Mar 23, 2006
83
US
Wow this is frustrating!
I am trying to export some access query results to a .csv file. In the query a field whose value is always an integer converts to a decimal upon export. For example in the query results the value is "2" upon export it becomes "2.00". I tried doing a "Make Table query" and setting the number format to decimel places 0. I also tried formatting the field as text instead of number but no matter what, upon exporting an integer becomes a number with 2 decimel places.

I also have a similar problem with dates. No matter what I do, when I export a "short date", the time is added to the field. For example the value "10/07/2007" becomes "10/07/2007 0:00:00" when exported.
 




Hi,

This is a distinction without a difference.

2 equals 2.0

10/07/2007 equals 10/07/2007 0:00:00

Its ONLY formatting. The underlying VALUES are identical.

Skip,
[sub]
[glasses] When a diminutive clarvoyant had disappeared from detention, headlines read...
Small Medium at Large[tongue][/sub]
 
Are you sure it is dumping bad data in the CSV file? I mean Excel does all kinds of evil formating things all by itself.

Formats of fields in queries don't export what is exported. However if you use the format function that returns a string/text, the string should get exported with less hassle.
 
Have you tried formatting the query, that is, instead of ThisField, Format(ThisField,"yyyy/mm/dd") or Format(TheInt,"#")
 
Skip,

I aggree but depending on where the CSV is going, having a number with a precision of an integer versus a decimal with 2 places may make a difference.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top