Below T-SQL script return no. of days for given date.
Declare @InputDate as datetime
Set @InputDate = ‘15-oct-2009′
Set @InputDate = cast(cast(month(@Inputdate) as char) + ‘-01-’ + cast(year(@InputDate) as char) as datetime)Select day(dateadd(d,-1,dateadd(M,1,@InputDate))) as ‘Days’
Thursday, October 15, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment