What is the equivalent of Oracle's LAST_DAY() function in SQL Server 2008?
sql-server, sql-server-2008-r2
Solution
Try this one -
DECLARE @Date DATETIME
SELECT @Date = GETDATE()
SELECT DATEADD(MONTH, DATEDIFF(MONTH, 0, @Date) + 1, 0) - 1
Problem
I have used the LAST_DAY() function in Oracle like this: `Last_Day( to_date( '$pay_first_day' , 'YYYY-mm-dd') )` What do i have to do in SQL server 2008 R2 database to achieve the same result?