String to Date Format
Moderators: chulett, rschirm, roy
String to Date Format
Hi All,
I need to change the string to date. My source has the value 20070125 and I need to chnage it date. My tagret is Teradata.
I used
" Oconv(Iconv(Input._DT, "DYMD"), "D-YMD[4,2,2])" .
But the row is geting rejected.
Please Advise.
Thanks & Regards,
Kumar66
I need to change the string to date. My source has the value 20070125 and I need to chnage it date. My tagret is Teradata.
I used
" Oconv(Iconv(Input._DT, "DYMD"), "D-YMD[4,2,2])" .
But the row is geting rejected.
Please Advise.
Thanks & Regards,
Kumar66
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
What format does Teradata require?
Your Iconv() function is good.
Your Oconv() function is good only if Teradata requires YYYY-MM-DD format.
What error message is logged?
Your Iconv() function is good.
Your Oconv() function is good only if Teradata requires YYYY-MM-DD format.
What error message is logged?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Please post the full warning. We need to know where it is being generated.
If it is being generated in the Transformer stage (no Teradata stamps in the message) then the derivation is awry (which I doubt).
Break up the expression into two stage variables, one with the Iconv() and one with the Oconv() function. Use stage tracing or the Debugger to determine whether it is the Iconv() or Oconv() function that is failing, or neither.
If the message is stamped as having been generated by Teradata (or by an ODBC driver), then verify that the expected date format is as you posted. Don't assume, check.
If it is being generated in the Transformer stage (no Teradata stamps in the message) then the derivation is awry (which I doubt).
Break up the expression into two stage variables, one with the Iconv() and one with the Oconv() function. Use stage tracing or the Debugger to determine whether it is the Iconv() or Oconv() function that is failing, or neither.
If the message is stamped as having been generated by Teradata (or by an ODBC driver), then verify that the expected date format is as you posted. Don't assume, check.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Hi Ray,
I have posted the full warning :
Stg..TX_MTRF: At row 1, link "out_TRF", while processing column "EFF_DT"
Value treated as NULL
Attempt to convert String value "2007-01-25" to Date type unsuccessful
Stg..TX_MTRF: Column EFF_DT cannot be null.
Stg..TX_MTRF: EFF_DT = NULL FRCH_ID = 1249 RTL_CTRY_CD = PH FRCH_LOC_ID = ABCD TRF_QTY = 5
Thanks & Regards,
Kumar66
I have posted the full warning :
Stg..TX_MTRF: At row 1, link "out_TRF", while processing column "EFF_DT"
Value treated as NULL
Attempt to convert String value "2007-01-25" to Date type unsuccessful
Stg..TX_MTRF: Column EFF_DT cannot be null.
Stg..TX_MTRF: EFF_DT = NULL FRCH_ID = 1249 RTL_CTRY_CD = PH FRCH_LOC_ID = ABCD TRF_QTY = 5
Thanks & Regards,
Kumar66