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!

Trying to combine date / time text into a datetime field

Status
Not open for further replies.

csbmis

IS-IT--Management
Jan 15, 2004
2
US
Environment: SQL Server 2005
SSIS Visual studio 2005

I'm trying to set up a task to take two separate fields from a flat file source (one is a date and one is a time) and combine them into one datetime field on SQL Server.

flat file:
Pick_Dt
Pick_Tm

combine them into one field named:
Pick_TS (type datetime)

I tried using "derived column" transform, but it errors out on everything I've tried so far.

All the other fields transform 1:1 from flat file to table with no problems.

Thanks for any help.
 
Ideally you need to concatenate the two strings separated by a space into the following format: YYYY-MM-DD hh:mm:ss. Then a simple CAST AS DATETIME should get to a single DATETIME data type.

--------------------------------------------------
“Crash programs fail because they are based on the theory that, with nine women pregnant, you can get a baby a month.” --Wernher von Braun
--------------------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top