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

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
its_me48
Participant
Posts: 33
Joined: Fri Apr 29, 2005 10:09 am

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

Post 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!!
anbu
Premium Member
Premium Member
Posts: 596
Joined: Sat Feb 18, 2006 2:25 am
Location: india

Post by anbu »

Use SecondsSinceFromTimestamp
You are the creator of your destiny - Swami Vivekananda
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Then * 60. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
its_me48
Participant
Posts: 33
Joined: Fri Apr 29, 2005 10:09 am

Post 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: ...
anbu
Premium Member
Premium Member
Posts: 596
Joined: Sat Feb 18, 2006 2:25 am
Location: india

Post by anbu »

Thats correct
You are the creator of your destiny - Swami Vivekananda
Post Reply