All Forums Tools
RevathiS 5 posts Joined 08/16
18 Aug 2016
Month days !!!

Hi,
Could any one explain this code logic,
DAY(DATEADD(ms,-2,DATEADD(MONTH, DATEDIFF(MONTH,0,CURRENT_DATE.DAY)+1,0)))
and provide me alternate code in tera data...
 
Thanks..

dnoeth 4628 posts Joined 11/04
19 Aug 2016

What DBMS is this?
Looks like MS SQL Server, but this CURRENT_DATE.DAY is strange.
 
Would be easier if you add the current result, but this seems to return the last day of the current month:
EXTRACT(DAY FROM LAST_DAY(CURRENT_DATE))

 
 

Dieter

You must sign in to leave a comment.