Simple TSQL to get the number of days in the current month

SELECT DAY(DATEADD (m, 1, DATEADD (d, 1 – DAY(GETDATE()), GETDATE())) – 1)

Leave a Reply