SDU Tools: Calculate number of days in a month using T-SQL
When I’m working with dates, I often need to calculate how many days there are in a specific date.
So, in our free SDU Tools for developers and DBAs, we added a simple tool that does just that. It’s called DaysInMonth.
It takes one parameter:
@Date date - the date to check
Nothing complex. It takes a date, and returns the number of days in the month that contains that date.
2019-08-28