How can I in SSIS combine these two fields into 1 column of type datetime? Both source tables are in datetime and so is the target table.
Dates
2009-03-12 00:00:00.000
2009-03-26 00:00:00.000
2009-03-26 00:00:00.000
Times
1899-12-30 12:30:00.000
1899-12-30 10:00:00.000
1899-12-30 10:00:00.000
You need two steps to achieve your goal.
1) First merge both Dates and Times into a single row. I am guessing you have a key to tie the two up, so use this inside a merge join transformation (you will need to sort by this column prior to entering the merge) to create a single row e.g.
2) Convert the two columns into one inside a derived column transformation with the following casts
(DT_DBTIMESTAMP)(SUBSTRING((DT_WSTR,23)Dates,1,11) + SUBSTRING((DT_WSTR,23)Times,12,8))This should provide you with a new column of datetime to insert into your database e.g.