[AccessD] Import Date from Excel

Dan Waters dwaters at usinternet.com
Thu Mar 18 08:33:35 CST 2004


David,

I believe that December 31, 1899 = 0 in Excel (on a PC that is not using
1904 date format).  Check this to be sure.

Perhaps you could add the 38018 to 12/31/1899 in code to get the correct
date?

HTH,
Dan

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of David Emerson
Sent: Wednesday, March 17, 2004 6:25 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Import Date from Excel

A further piece of info - I can't set the SQL field to datetime as it 
rejects the number as not being a date when it is imported.

David

At 18/03/2004, you wrote:
>I have a spreadsheet in Excel that is imported into a SQL2000 
>table.  Because the field types are unknown the SQL fields are
varchar(200).
>
>The problem is with dates - excel shows a date as 2/1/2004 but in the SQL 
>table it is imported as 38018.
>
>I am using VBA to deal with each row at a time.  How do I convert the 
>number (38018) into a date?
>
>Regards
>
>David Emerson
>Dalyn Software Ltd
>25 Cunliffe St, Churton Park
>Wellington, New Zealand
>Ph/Fax (877) 456-1205
>--
>_______________________________________________
>AccessD mailing list
>AccessD at databaseadvisors.com
>http://databaseadvisors.com/mailman/listinfo/accessd
>Website: http://www.databaseadvisors.com
>

-- 
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list