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
 SQL Retrieve Files updated in last 30 mins

Author  Topic 

Velnias
Yak Posting Veteran

58 Posts

Posted - 2008-10-24 : 11:40:38
Was wondering how to put a clause on my select statement to only retrieve files updated in the last 30 mins.

Also I have 2 colums DateAdded and DateUpdated It would also have to check which has the most current datetime. Using SQL 2005.

Any Ideas

Thanks

hanbingl
Aged Yak Warrior

652 Posts

Posted - 2008-10-24 : 11:49:21
select ... from tabl
where
case when dateadded > dateupdated then dateadded else dateupdated end >= dateadd(minute,-30,getdate())

Go to Top of Page

Velnias
Yak Posting Veteran

58 Posts

Posted - 2008-10-24 : 12:10:01
Thanks Hanbingl
Go to Top of Page
   

- Advertisement -