| Refresh | Home EGTry.com

get the last day of the previous month


date-extract(day from date)

sql against teradata

select date Today ,extract(day from date) NumberOfPastDayThisMonth, date-extract(day from date) as LastDayOfPreviousMonth


result

Today NumberOfPastDayThisMonth LastDayOfPreviousMonth
10/28/2011 28 09/30/2011