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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Export Date Field to CSV without TIME Being Associated

Status
Not open for further replies.

jdegeorge

Programmer
Mar 19, 2002
1,313
US
Hi

I have a table with a date field that defaults to DATE() for each new record. When I export this file to CSV format, the date becomes 5/9/2006 00:00:00 rather than 05/09/2006.

If I look at the table in Access only the date appears there in the desired format 05/09/2006 but gets messed up somehow upon export.

Help? :)

Jim DeGeorge [wavey]
 
Did you use some Specification for the export ?
Another way is to export a well formatting query instead of the table.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
I do use an export specification. There was no setting to remove TIME.

Jim DeGeorge [wavey]
 
What is stored and what is displayed are often 2 different things.

If you do not like my post feel free to point out your opinion or my errors.
 
ceh4702

What post are you talking about? Other than your response, only PHV has responded. Did you post any comments perhaps on another thread by accident?

Jim DeGeorge [wavey]
 
ACCESS Stores both date and date time fields. When you see a date like 10/10/2005 it is stored as an integer value in the Access Database. 10/10/2005 is just a display of that integer base on a conversion process.

This is for VB but I think it is consistant accross all microsoft applications:

Microsoft® Visual Basic® for Applications (VBA) provides the Date data type to store date and time values. The Date data type is an 8-byte floating-point value, so internally it is the same as the Double data type. The Date data type can store dates between January 1, 100, and January 1, 9999.

VBA stores the date value in the integer portion of the Date data type, and the time value in the decimal portion. The integer portion represents the number of days since December 30, 1899, which is the starting point for the Date data type. Any dates before this one are stored as negative numbers; all dates after are stored as positive values. If you convert a date value representing December 30, 1899, to a double, you'll find that this date is represented by zero.

The decimal portion of a date represents the amount of time that has passed since midnight. For example, if the decimal portion of a date value is .75, three-quarters of the day has passed, and the time is now 6 P.M.

Because the integer portion of a date represents number of days, you can add and subtract days from one date to get another date.

So I think you can strip off the time by making it an integer.

This is the link that Access Help pointed me to for Date Information:


If you do not like my post feel free to point out your opinion or my errors.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top