Calculate the Last Day of the Month
Here is how to calculate the last day of the current month.
Powerbuilder
date ld_eom ld_eom = RelativeDate(Date(String(Month(Today()) + 1) + "/1/" + String(Year(Today()))), -1)
SQL Server
SELECT DATEADD(DAY, -1, DATEADD(MONTH, DATEDIFF(MONTH, 0, Getdate()) +1, 0))
I quess SQL Denali has a new function (EOMONTH) to do this too.
SELECT EOMONTH(GETDATE())