May 16, 2012

SQL SERVER – Script/Function to Find Last Day of Month


DECLARE @date DATETIME
SET @date= getdate()
SELECT DATEADD(dd, -DAY(DATEADD(m,1,@date)), DATEADD(m,1,@date))

No comments:

Post a Comment