Here is a small script that will give you the number of days for given month. Example purpose, i am retrieving month from the current date.
declare @numberOfDaysInMonth int;
set @numberOfDaysInMonth = DAY(DATEADD (m, 1, DATEADD (d, 1 - DAY(getdate()), getdate())) - 1);
No comments:
Post a Comment