Members may post updates or alternatives to this current article in order to show different
approaches or add new features.
How to find Number of Days in Sql Server for a specific dateFor Example Declare @date datetime='2012-11-25'I have to find No. of days for @date (ie)Number of days for November monthMy answer should be 30
try the below one and pass your requried monthSELECT DATEPART(dd, DATEADD(s,-1,DATEADD(mm,DATEDIFF(m,0,getdate())+1,0)))