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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Last 7 days Details

Author  Topic 

Kotti
Posting Yak Master

129 Posts

Posted - 2008-10-17 : 04:34:14
Hi friends ,

i want to get the last 7 days details from the current date.will you help to do this?

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-10-17 : 04:39:18
SELECT *
FROM Table1
WHERE Col1 >= DATEADD(DAY, -7, GETDATE())



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-10-17 : 04:50:40
SELECT *
FROM Table1
WHERE Col1 >= DATEADD(DAY, DATEDIFF(DAY,0,GETDATE())-7,0)
Go to Top of Page
   

- Advertisement -