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