hi everybody,
how to find difference between two dates using Datastage
i.e expecting output in terms of days
plz do needful
date type??
Moderators: chulett, rschirm, roy
Hello Info_DS,
DataStage internal representation of dates is in a number of days since 31/12/1967. So if you have two dates in text format, i.e. "1 jan 2005" and "8 Feb 2005", you would simply do a mathematical formula on the internal values in a transform (or in a function/routine if you wish):
and the result is the integer number of days between the two. The "D4" format is dependant upon the input format, but you can read up on the possibilities in the DataStage documentation.
DataStage internal representation of dates is in a number of days since 31/12/1967. So if you have two dates in text format, i.e. "1 jan 2005" and "8 Feb 2005", you would simply do a mathematical formula on the internal values in a transform (or in a function/routine if you wish):
Code: Select all
ICONV({LaterDate},"D4")-ICONV({EarlierDate},"D4")
and the result is the integer number of days between the two. The "D4" format is dependant upon the input format, but you can read up on the possibilities in the DataStage documentation.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>