Forum Replies Created

Viewing post 1 (of 1 total)

  • RE: Find Last Day of the Month

    Below is a one line statement to compute last date of the month for a given input date.

    DECLARE @MyDate datetime

    SET @MyDate = '2012/11/25'

    SELECT DATEADD(DAY,DATEPART(DAY,DATEADD(MONTH,1,@MyDate))*-1,DATEADD(MONTH,1,@MyDate))

    --Output result: 2012-11-30 00:00:00.000

Viewing post 1 (of 1 total)