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

Merge data and Time fields

Status
Not open for further replies.

ohmbru2

Technical User
Jul 24, 2001
51
US
I have a DTS package where there is a Date and a Time (separate fields). I want to create 1 field out of them and continue to transform them separarely.

I've tried to concatenate them, like this:

DTSDestination("swdatetime") = DTSSource("Col002")) & DTSSource("Col003")

That didn't work so I tried this:

DTSDestination("swdatetime") = DatePart("m", DTSSource("Col002")) & "/" & DatePart("d", DTSSource("Col002")) &, etc.

Any ideas how I can accomplish this?

 
Try using value
Code:
DTSDestination("swdatetime").value = DTSSource("Col002").value & DTSSource("Col003").value
 
Provided the fields are real DateTime fields, you may try this:
DTSDestination("swdatetime") = DTSSource("Col002") [!]+[/!] DTSSource("Col003")

Another way:
DTSDestination("swdatetime") = CDate(DTSSource("Col002")) + CDate(DTSSource("Col003"))

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top