Technical Article

Finding The Last Date of a Month

,

Select dateadd(month, 1 ,getdate()) gives the exact date of next month , then find the day of that date. Now back to that days i.e exactly last date of the given month.

select      (dateadd(day, -1*day(dateadd(month, 1 ,getdate())),dateadd(month, 1 , getdate())))

Rate

You rated this post out of 5. Change rating

Share

Share

Rate

You rated this post out of 5. Change rating