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
 SQL Server 2005 Forums
 Transact-SQL (2005)
 get past 1 week's data from system date

Author  Topic 

ricky_1605
Starting Member

30 Posts

Posted - 2011-06-03 : 00:53:42
Hey guys

I want to retrieve psat 1 week's data from system date. Please help me with the query.

Thanks

Nipun Chawla

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2011-06-03 : 01:07:16
[code]
where date_column > dateadd(day, datediff(day, 0, getdate()), -7)
[/code]


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

ricky_1605
Starting Member

30 Posts

Posted - 2011-06-03 : 01:32:57
Thanks a lot it worked.

Nipun Chawla
Go to Top of Page
   

- Advertisement -