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!

DateCoversion In Transformation

Status
Not open for further replies.

dstagedavid

Programmer
Dec 20, 2005
1
US
We have an SQL Server table with a integer (CCYYMMDD ) which represents a date in a data warehouse table. In the transform, how to I transform the CCYYMMDD data into the destination column which is MM/DD/YYYY?
 
in the transformer output column derivation, convert the integer to a string, and concatenate substrings from the string and the '/' characters to put it all together.

Assuming your input column with the integer is called inputdateval

Try the following:
Code:
inputdateval[5,2]:'/':inputdateval[7,2]:'/':inputdateval[1,4]

If you are loading into a date column (as opposed to a char column), you might need to first convert the string to a datastage internal date:
Code:
Iconv(inputdateval[5,2]:'/':inputdateval[7,2]:'/':inputdateval[1,4],"D")

Hope this helps
J

PS...i havent used datastage for a while, so my syntax might not be 100% - there is so much you can forget in a few years :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top