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

BCP and date formats

Status
Not open for further replies.

BeachSand

Programmer
Sep 20, 2005
1
US
Hi,

Is there a way to programmatically accept different date formats in BCP or BULK INSERT? The application will import from different data source which will probably have different date formats.

Is the better answer to require that the files be sent with a specific date format?

Thanks.

- Beach
 
Requesting to send the file in a specific format, that would be easier for you donw the line. If you still want to proceed with diff dates you might have to find out how many formats they will be sending, then you can use a case

[tt]
CASE when date=format1 then cast or convert (date1)
when date=format2 then cast or convert (date2)
when date=format2 then cast or convert (date3)
end
[/tt]


Dr.Sql
Good Luck.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top