cancel
Showing results for 
Search instead for 
Did you mean: 

Current Year Previous Year.

Former Member
0 Kudos

Hi Experts,

we want to calculate current date previous year.

I am able to do this in Webi, by using formula:

=If FormatDate(RelativeDate(CurrentDate();-365);"DD") = FormatDate(CurrentDate();"DD")

Then RelativeDate(CurrentDate();-365)

Else RelativeDate(CurrentDate();-366)

But i am not able to calculate it in IDT WITH HANA as Back end.

We don't have any table that have date field.

Can any one please help me for the same. That which function we can use for the same in IDT.

DATEADD,DATEDIFF are not working !!!!

Thanks in Advance!!!

Sheetal Sharma

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Yuvraj,

Thanks for suggestion.

i have found the function.

ADD_YEARS (TO_DATE (Current_date, 'YYYY-MM-DD'), -1)

Regards

Sheetal

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Sheetal,

I suppose it would be better to put this query under SAP HANA forum so that an expert can revert to it ASAP.

You can post it here:

http://scn.sap.com/community/hana-in-memory

Regards,

Yuvraj