Forum Replies Created

Viewing post 1 (of 1 total)

  • RE: t-sql first last day date of the month

    Hi,

    I think the Last date can be font by

    SELECT @r=dateadd(day,-(datepart(day,@d)),dateadd(mm,1,@d))

    No need to use

    SELECT @r=dateadd(day,-(datepart(day,dateadd(mm,1,@d))),dateadd(mm,1,@d))

    Because, datepart(day,@d) and datepart(day,dateadd(mm,1,@d)) will return the same result. Then why...

Viewing post 1 (of 1 total)