cancel
Showing results for 
Search instead for 
Did you mean: 

HANA SQL SCRIPT MONTHS_BETWEEN Function is not working

Former Member

Hi All,

I tired the below HANA SQL standard function to get difference between two dates but it is working only for "DAYS_BETWEEN" not for Months and Years. I followed the below SQL reference

http://help-legacy.sap.com/saphelp_hanaplatform/helpdata/en/9f/9eb73468b04bbc9d6014d22d2bfb90/conten...

Error Log

I got some solution from SCN https://archive.sap.com/discussions/thread/3877237

As i am working on Demo Hana cloud server i am not able to access it .

My question is why the standard date function " MONTHS_BETWEEN" and "YEARS_BETWEEN" are not working as "DAYS_BETWEEN?

Thank you All 🙂

Accepted Solutions (1)

Accepted Solutions (1)

pfefferf
Active Contributor

Both functions MONTHS_BETWEEN and YEARS_BETWEEN are added to HANA with HANA 1.0 SPS12. So I assume you are on a lower release level (DAYS_BETWEEN is already available since some SPS).

The link to the (legacy) online documentation, points to HANA 2.0 SPS00 in which the functions of course available too.

Regards,
Florian

Former Member
0 Kudos

Thanks for your reply : ) . Yes it's current version in 1.00.097 . I am using SAP HANA trail version . Is HANA 2.0 is available in HANA trail version? You have any idea about it ?

pfefferf
Active Contributor
0 Kudos

Seems like you are using a shared HANA instance which is still on HANA 1.0 SPS9 level. The HANA MDC instance available on SAP CP Trial is at level HANA 1.0 SPS12.

Former Member
0 Kudos

Thank you so much 🙂 HANA MDC Trail instance is working perfect .

Answers (0)