Getting external data from Excel.

T

techjohnny

When I import an Excel 97 spreadsheet into Access 2003, the DATE column
with the format DD/M/YY is imported in a strange format, example:

EXCEL: 10/2/06
Imported into Access 97: 389982

Anybody have an idea what this is happening?

Thanks,

--TJ
 
D

Douglas J. Steele

Do you mean 38992? Believe it or not, that's 2 October, 2006.

VBA stores dates as 8 byte floating point numbers, where the integer portion
represents the date as the number of days relative to 30 Dec, 1899, and the
decimal portion represents the time as a fraction of a day. 2 Oct 2006 just
happened to be 38,992 days since 30 Dec, 1899.

Just put the appropriate Format on the field.
 
T

techjohnny

Ok, so I right-click the excel cell, click format, and select the
appropriate date format, then import it into an Access db table? I've
tried this and the cells are still having the fraction format. Do I
have to change the format from 2/10/2006 to 2102006?

Thanks,


--TJ
 
Top