Declare @date datetime='2012-11-25'
DECLARE @date DATETIME, @Month DATETIME, @Days INT SELECT @date='2012-11-25' SELECT @Month=DATEADD(MONTH,1,@date),@Days = DAY(@Month - DAY(@Month)) SELECT @Days [Day(s)]
DECLARE @date DATETIME SELECT @date='2012-11-25' SELECT DAY(DATEADD(MONTH,1,@date) - DAY(DATEADD(MONTH,1,@date))) [Day(s)]
Cheers www.SQLServerbuddy.blogspot.com iLink Multitech Solutions
DECLARE @dtDate DATETIME SET @dtDate = '2011/11/28' SELECT @dtDate= dateadd(mm,datediff(mm,0,@dtDate),0) SELECT datediff(dd,@dtDate,dateadd(mm,1,@dtDate))
Ready to accept challenges at any time.....
Login to post response