Page 1 of 1

Help: How to get time in minutes by subtracting dates !!

Posted: Wed May 26, 2010 8:34 am
by its_me48
DataStage: 8.1 Enterprise
Database: Oracle 10g

I have 2 date columns (Timestamp datatype); one date comes out of driver query and other comes out of dataset. I want to subtract the date coming out driver query (Dt_Tm_1) from the dataset (Dt_Tm_2) in Transformer to check for <= 60 minutes. (Dt_Tm_2 - Dt_Tm_1 <= 60 minutes). How would I do it in the transformer? I am guessing I need to using Iconv/Oconv that I am not familiar with?... any easy way to check this in transformer?

BTW, Cannot do it in oracle SQL query due to the nature of data.. else doing it in oracle sql would be easy (Where Dt_Tm_2 - Dt_Tm_1 <= 1/24)....

Appreciate your response(s).

Thanks!!

Posted: Wed May 26, 2010 8:41 am
by anbu
Use SecondsSinceFromTimestamp

Posted: Wed May 26, 2010 9:17 am
by chulett
Then * 60. :wink:

Posted: Wed May 26, 2010 10:02 am
by its_me48
So, the code would be:
SecondsSinceFromTimestamp(Dt_Tm_2, Dt_Tm_1) <= 3600 (60 minutes)

Please correct me if I am wrong..

Thanks all for your replies.
chulett wrote:Then * 60. :wink: ...

Posted: Wed May 26, 2010 10:30 am
by anbu
Thats correct