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

Problems importing Excel date data

Status
Not open for further replies.

MrPeds

Programmer
Jan 7, 2003
219
GB
Hi,

I am having problems importing a particular Excel spreadsheet into a SQL Server table.

I have tried saving the excel file as a tab-delimited text document to import, but if the date is in this format:
"dd/mm/yyyy "
SQL Server 2000 seems to want to convert it into mm/dd/yyyy format which scews up my caculations. I am importing into a datetime column.

Not sure if i need another file type to import from?

SHould i convert the date on the fly in an ActiveX script when i import the data? If so, which VBScript function do i use?

i know there is CDate, and FormatDateTime, but you cant format the date like the VBA function Format(Now(), "dd/mm/yyyy"), what do people suggest?

THanks,


MrPeds
 
There are always problems importing from excel - something I believe is a known problem with the drivers for excel - I always save the excel sheet as a text file and import that.

[bandito] [blue]DBomrrsm[/blue] [bandito]

[blue]Software code, like laws and sausages, should never be examined in production[/blue][black] - [/black][purple]Edward Tenner[/purple]
 
thanks - in the end i saved that data to a DB5 file and it works without any problems.

Peds
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top