May 4, 2005 at 9:08 am
Hi ,
I am running a query like this
select * from tblOrders where orderDate > '2004-12-31' and FREE = '1'
this bit runs fine but I want to add onto it to pick out which rows do not have a specific order code 'abc'
I have tried adding : and Order code NOT 'abc' but syntax is wrong can anyone assist.
Can you add NOT to a select query to exclude certain rows ?
If not, can you advise if this can be done and how?
thanks
paul
May 4, 2005 at 9:09 am
try using != or <>.
May 4, 2005 at 9:15 am
select * from tblOrders where orderDate > '2004-12-31' and FREE = '1' AND [Order code] 'ABC'
May 4, 2005 at 4:03 pm
As an aside, I'd recommend using over != since is part of the SQL-92 standard, but != is not. Both operators provide equivalent functionality.
May 5, 2005 at 3:13 am
You can use NOT in queries, especially in connection with other keywords: IS NOT NULL, NOT EXISTS, NOT BETWEEN. But if you simply want to say "is not equal to", then use <>.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply