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 |
darms21
Yak Posting Veteran
54 Posts |
Posted - 2012-08-10 : 11:14:57
|
I want to show all records except those where the status is 'delivered' AND update date is more than 1 day ago.Having trouble.... |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
|
darms21
Yak Posting Veteran
54 Posts |
Posted - 2012-08-10 : 11:19:21
|
Never mind, I got it:SELECT *FROM TESTwhere status not like 'delivered' or (status like 'delivered' and update_date > dateadd(day, -1, getdate()))order by hstatus, update_date |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-08-10 : 11:22:04
|
update date is more than 1 day agodo you mean from 1 day ago forward or backward?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
|
|
|