A.Leggett
A.Leggett

Reputation: 61

Convert set of Dates to End of Month Date

Using Oracle SQL, how can I transform a set of dates to the date for the end of that month? Example below:

  Date        Amount
18/05/18        10
24/05/18        40
30/05/18        60

  Date        Amount
31/05/18       110

Thanks

Upvotes: 1

Views: 94

Answers (1)

dnoeth
dnoeth

Reputation: 60462

Simply apply last_day (if there's a time part you must apply trunc to remove it):

TRUNC(LAST_DAY(datecol))

Upvotes: 8

Related Questions