Page 1 of 1

How to get the previous date in Transformer

Posted: Sat Jan 12, 2008 12:50 am
by SURA
Hi,

I need to get the previous date (Current date - 1) in stage variable. How to get it. Pls help me.

Sura

Re: How to get the previous date in Transformer

Posted: Sat Jan 12, 2008 1:51 am
by arnie_nits
SURA wrote:Hi,

I need to get the previous date (Current date - 1) in stage variable. How to get it. Pls help me.

Sura
Can do this way....
Take two stage variables Stg1 and Stg2.....initialize as 9999-01-01 to both.

If Stg2<>Stg1 Then Stg2 Else Stg1-------->Stg1
and
Input latest date field --------------------------->Stg2

So in Stg1 You can will get the previous date and in Stg2 the latest date...
Regards
Arnie

Posted: Sat Jan 12, 2008 5:21 am
by ray.wurlod
DateFromDaysSince() function should do it for you. The days offset can be negative.

Re: How to get the previous date in Transformer

Posted: Sat Jan 12, 2008 8:42 am
by SURA
SURA wrote:Hi,

I need to get the previous date (Current date - 1) in stage variable. How to get it. Pls help me.

Sura
I found the solutions.

DateFromJulianDay(JulianDayFromDate(Your_Date)-1).

Thanks for the efforts.

Sura