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 |
disha
Starting Member
34 Posts |
Posted - 2008-02-21 : 06:14:09
|
whenver i fire a sql query i want to get data 1 month prior same date to it eg : if i say 28 dec then it should go back to 28 november .can u tel me the code in sql server to accomplish this condition |
|
RickD
Slow But Sure Yak Herding Master
3608 Posts |
Posted - 2008-02-21 : 06:16:51
|
where date <= dateadd(mm,-1,@YourDate) |
 |
|
disha
Starting Member
34 Posts |
Posted - 2008-02-21 : 06:19:07
|
thnxx will it work perfectly for february |
 |
|
RickD
Slow But Sure Yak Herding Master
3608 Posts |
Posted - 2008-02-21 : 07:57:28
|
Try it and you will see. |
 |
|
|
|
|