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!

Date Formatting and converting

Status
Not open for further replies.

jcoleman

MIS
Dec 24, 2002
87
CA
HI guys,

Here's today's problem. I'm using DTS to import data from a csv file into my SQL database. The csv file has dates in the format of MM/DD/YY. My SQL database is storing them as YYYY/MM/DD.

How would I use DTS to convert the MM/DD/YY format into the correct SQL format?

Thanks,
 
I believe for the server the order does not mater but when you look at it I know it looks funny. I believe you can use the SET DATEFORMAT command to change the setting of the server.
 
Ok I have an answer for you, that last one I posted ends up being just a temp solution only working if when you input the date(not that helpful for you).
2 things.
1 make sure in the properties of you server that the language setting is English that will correct it while in enterprise manager.
2 in query analyzer make sure to turn on the use regional settings when displaying money/date/time/etc.

That should help you. Let me know how it goes.
 
If you are in North America, shouldn't that work out-of-the-box. Please tell me the field in SQL database is type datetime.

If it's not working, lets find the cause and find a solution.

Cheers


[blue]Backup system is as good as the latest recovery[/blue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top