 |
 |
Days of Month
To find how many days in this month :
declare @dt datetime
set @dt = getdate()
select DT = @dt, [Days in Month] =day(dateadd(mm,datediff(mm,-1,@dt),-1))
|
The same to :
|
select DT = '2007-02-13', [Days in Month] =day(dateadd(mm,datediff(mm,-1,'2007-02-13'),-1))
|
Change the month number to see the effect.
| Comment no. 1 |
and the same as:
select[Days in Month] =day(dateadd(mm,datediff(mm,-1,'2007-02-13'),-1))
From Date 04/03/50 Time 12.08 [202.72.105.82]
|
| Comment no. 2 |
abc
From 163Öá³ÐÍø Date 08/07/50 Time 19.59 [60.191.36.91]
|
| Comment no. 3 |
wo
From zzz Date 20/11/50 Time 22.40 [60.190.240.76]
|
|
 |