Quantcast
Channel: SCN: Message List - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 9165

Re: Display last 3 months from the entered date in SAP HANA

$
0
0

you will need to replace this midstr('$$INP_CALMONTH$$',5,6) - 1),"A",0)

 

with the below function for month -3

to_char(ADD_MONTHS (TO_DATE (concat( '$$INP_CALMONTH$$' ,'01'), 'YYYYMMDD'), -3),'YYYYMM')

 

 

 

What I am doing here is creating the fist date of that month using concat and then and going 3month back from that month using ADD_MONTH (with -3) and then converting the date back to your YYYYMM formar..


Viewing all articles
Browse latest Browse all 9165

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>