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!

Military time converion issue

Status
Not open for further replies.

DrewConn

Programmer
Jan 8, 2002
167
US
I am trying to import date data in the following format into a datetime field using DTS and the DateTimeString transformation tool to do it. However when ever it hits an hour field > 12 it throws a conversion error:

The raw data looks like this:
20050522142901

Source data format used :yyyyMMddhhmmss
Destination data format used: mm-dd-yyyy format.

How can I get SQL to recognize this as a military time value?

Thanks.
 
When you import the military time, do you want to ignore the time and just import the date?
 
To insert with the format you have you have to do some converstion first to the string

This
20050522142901

needs to be chaned to this for the Insert to work
'20050522 14:29:01'
 
Yes I want to ignore the time and only bring in the date
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top