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 |
|
ramu143
Yak Posting Veteran
64 Posts |
Posted - 2008-05-13 : 05:59:56
|
| i need before 7 days from sysdateand before 15 days from sys datebefrore one month from sysdate |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
|
|
soorajtnpki
Posting Yak Master
231 Posts |
Posted - 2008-05-13 : 06:24:39
|
| hi try thisSELECT DATEADD(day,-7,GETDATE())SELECT DATEADD(month,-1,GETDATE())ok tanx.. |
 |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2008-05-13 : 06:37:48
|
quote: Originally posted by soorajtnpki hi try thisSELECT DATEADD(day,-7,GETDATE())SELECT DATEADD(month,-1,GETDATE())ok tanx..
That includes time part and may not give correct answer if time is stored in the column.Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
soorajtnpki
Posting Yak Master
231 Posts |
Posted - 2008-05-13 : 06:41:15
|
| ok then wat will be the solution??ok tanx |
 |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2008-05-13 : 06:43:44
|
| For that we need to know whether OP stores time part in the table and is it important for calculating date difference.Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
ramu143
Yak Posting Veteran
64 Posts |
Posted - 2008-05-13 : 07:04:39
|
| thnks harsh |
 |
|
|
|
|
|