Ok, I did some more playing with this. I noticed when I got the column wide
enough that Excel would right justify the dates on or after 1/1/1900 and
left justify the dates on or before 12/31/1899. If I converted the column to
text, the dates on or after 1/1/1900 would show their serial date numbers,
the dates on or before 12/31/1899 would still show the date. It appears that
even though these columns are being formatted as dates, Excel is treating
anything before 1900 as text. If you are importing into a date type field,
this is probably the cause of the problem.
One work around would be to add 100 or 200 years to all the values in the
Excel sheet then subtract that back out once you have the data in Access. I
haven't tried this, but since the dates before 1900 are being treated as
text, this may be hard to do.
Another work around would be to have 3 fields, one for day, one for month,
and one for year. Recombine them once you have the data in Access.
I tried changing the column in Excel to Text. When I did this, the dates
after 1900 changed to serial dates as mentioned above. I then imported this
into an Access table. Access assigned this column to a text field. I then
created a query using this table and used the following calculated field to
convert the values. It showed all of them correctly.
Test: Format(CDate([Feild1]),"Short Date")
I tried exporting the sheet as a .csv file (comma delimited file) and then
import that into Access. That appeared to work properly. It also didn't gray
out the options to import into a current table or to define the field type
as working directly with the Excel file did. This may be the easiest way to
handle this.
Since the problem appears to be on the Excel side, the Excel folks may be
able to help more.
--
Wayne Morgan
MS Access MVP
Jim J. said:
I make sure the appropriate columns are properly formatted as dates in
Excel.
When Access builds the table with the import wizard, it automatically
formats those fields as date/time. It does not specify the fields as
"general dates" or short dates" or any kind of "subformat" (pardon the
clumsiness of my phrasing) for that field.