Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
Akshaya Pargunan
Starting Member
10 Posts |
Posted - 2011-10-12 : 07:28:04
|
hi how to get start date of november and end date of october from getdate()it should be like 01-11-2011 to 31-10-2012 |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2011-10-12 : 07:44:57
|
[code]select dateadd(month, datediff(month, 0, getdate()) + 1, 0), dateadd(month, datediff(month, 0, getdate()) + 13, -1)[/code] KH[spoiler]Time is always against us[/spoiler] |
|
|
nigelrivett
Master Smack Fu Yak Hacker
3385 Posts |
Posted - 2011-10-12 : 07:47:51
|
select dateadd(mm,10,dateadd(yy,datediff(yy,0,getdate()),0))select dateadd(mm,10,dateadd(yy,datediff(yy,0,getdate()),0))-1==========================================Cursors are useful if you don't know sql.SSIS can be used in a similar way.Beer is not cold and it isn't fizzy. |
|
|
Akshaya Pargunan
Starting Member
10 Posts |
Posted - 2011-10-12 : 07:48:32
|
Thank u very much |
|
|
|
|
|
|
|