Difference between 2 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
dsa
Participant
Posts: 37
Joined: Sun Oct 10, 2010 7:52 am

Difference between 2 dates

Post by dsa »

Hi,

I need to get number of days between two dates in transformer. One of them is having format: 12/25/2009 and other one is like 1/21/2000 12:00:00.000000 AM.

Basically I need to implement TRUNC(DATE) functionality of Oracle.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

FYI - that function returns just the date from a DATE field which is an Oracle data type that includes the time. Technically it returns the date with the time set to midnight so again (technically) they are equivalent when your time portion is set to midnight.

Since you are mentioning their "format" are they both actually strings? Or is one a Date and one a Timestamp? I mean those actual data types in the job, not just varchar fields that look like that. :wink:

In either case, look into the DaysSinceFromDate function.
-craig

"You can never have too many knives" -- Logan Nine Fingers
dsa
Participant
Posts: 37
Joined: Sun Oct 10, 2010 7:52 am

Post by dsa »

Thanks Craig. It helped.
Post Reply