Hi,
My requirement is like this.I have one column whoes data type is varchar and data is like 4/17/2002 00:00:00
I am mapping this column with my target column whoes data type is date.
Can anybody tell me the funciton to convert it into date format.
I need to retain all the 18 characters of the original column.
Thanks in advance,
Nilesh
Need function in datastage to convert string datatype todate
Moderators: chulett, rschirm, roy
Need function in datastage to convert string datatype todate
Nilesh Malekar
Depends on your target what 'date format' means. And depending on how trustworthy your data was, you could just use substring to get that into date format or combine that with IConv/OConv if there were any doubts.
Check out your online help for the IConv/OConv functions using the 'D' and 'MT' conversion codes. Substring is the square brackets '[]' or the Field function can be used as well.
Check out your online help for the IConv/OConv functions using the 'D' and 'MT' conversion codes. Substring is the square brackets '[]' or the Field function can be used as well.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Re: Need function in datastage to convert string datatype to
hello, if your target column is for database then you need to use database specific date formating like to_date(), otherwise just check for proper length for that date column.
-
- Participant
- Posts: 132
- Joined: Wed Mar 01, 2006 11:12 pm
- Location: Pune
Re: Need function in datastage to convert string datatype to
Its your call. you can use the Iconv function or also use the substring function in the derivation of the output link.
nilesh wrote:Hi,
My requirement is like this.I have one column whoes data type is varchar and data is like 4/17/2002 00:00:00
I am mapping this column with my target column whoes data type is date.
Can anybody tell me the funciton to convert it into date format.
I need to retain all the 18 characters of the original column.
Thanks in advance,
Nilesh
SMB
Re: Need function in datastage to convert string datatype to
First get it into the 'proper' format then let the SQL generate with the correctly masked version of TO_DATE(), whatever the equivalent is in your database - that's specific to Oracle as far as I know.sachin1 wrote:hello, if your target column is for database then you need to use database specific date formating like to_date(), otherwise just check for proper length for that date column.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers