Translate

Saturday, 28 April 2018

sql : last date of the month

SELECT DATEADD(d, -1, DATEADD(m, DATEDIFF(m, 0, GETDATE()) + 1, 0))
SELECT convert(varchar,DATEADD(d, -1, DATEADD(m, DATEDIFF(m, 0, GETDATE()) + 1, 0)),103)

No comments:

Post a Comment