Page 1 of 1

Difference between 2 dates

Posted: Sat Jan 19, 2013 8:48 am
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.

Posted: Sat Jan 19, 2013 9:12 am
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.

Posted: Sat Jan 19, 2013 12:40 pm
by dsa
Thanks Craig. It helped.