select days_of_month=day( dateadd(d,-1, dateadd(m,1, dateadd(d,1-day(@dt), @dt) ) ) )
This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)