How to calculate the difference between two dates in Transformer stage in Datastage? Basically, I want to find the equivalent function for SQL Server "Datediff" in Datastage. Could any one help me please?
Thanks,
Diff between two dates in Datastage
Moderators: chulett, rschirm, roy
Welcome! :D
Dates need to be converted to 'internal' format first, then those two dates can simply be subtracted to get the number of days between them. Is that the unit of difference you are interested in - # of days?
The IConv function will do the conversion for you, basically:
Where the information between the two quotes is the proper date mask for your incoming date. Adjust that to match your data.
Dates need to be converted to 'internal' format first, then those two dates can simply be subtracted to get the number of days between them. Is that the unit of difference you are interested in - # of days?
The IConv function will do the conversion for you, basically:
Code: Select all
IConv(YourDate,"D-YMD")
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
The date gets converted to the datastage format, so that u may get the output in numeric format rather than as a date.
SO u can use either iconv or oconv functions depending on your needs.
Iconv- converts to the local datastage format i.e a number
OConv- converts to the date format
jus check out the help for the syntax and for the format.
SO u can use either iconv or oconv functions depending on your needs.
Iconv- converts to the local datastage format i.e a number
OConv- converts to the date format
jus check out the help for the syntax and for the format.
222102
The date gets converted to the datastage format, so that u may get the output in numeric format rather than as a date.
SO u can use either iconv or oconv functions depending on your needs.
Iconv- converts to the local datastage format i.e a number
OConv- converts to the date format
jus check out the help for the syntax and for the format.
SO u can use either iconv or oconv functions depending on your needs.
Iconv- converts to the local datastage format i.e a number
OConv- converts to the date format
jus check out the help for the syntax and for the format.
222102
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
There's an obvious problem with SHARAD23's answer, and it is that U did not ask the question. It was asked by srn2006.
In English, the second person personal pronoun is spelled "you".
In English, the second person personal pronoun is spelled "you".
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.