Mixing my NOT's and OR's in my Access query ??

dsundy2003

New Member
Joined
Dec 26, 2002
Messages
40
Hi there

I want to write a query that says "Give me the records where transaction date > #7 July 2002# and where the Status <> "PUR" or where Status <> "SET" "

I have tried all combinations, watching my brackets etc. But its not giving me what I want. Is it becasue I am mixing my NOT's and OR's is a single statement, which is confusing the logic ? But surely putting brackets will solve that problem.

Darryn
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
dsundy2003 said:
Hi there

I want to write a query that says "Give me the records where transaction date > #7 July 2002# and where the Status <> "PUR" or where Status <> "SET" "

I have tried all combinations, watching my brackets etc. But its not giving me what I want. Is it becasue I am mixing my NOT's and OR's is a single statement, which is confusing the logic ? But surely putting brackets will solve that problem.

Darryn

Hi,

I think you need an AND, not an OR. Can you post the SQL of your query?

I did this to return all records where the date is >7th July 2002 and where the Status isn't PUR and it isn't SET.

Code:
SELECT *
FROM MyTable
WHERE (((MyTable.TransactionDate)>#7/7/2002#) AND ((MyTable.Status)<>"PUR") AND ((MyTable.Status)<>"SET"))
 
Upvote 0
dsundy2003 said:
Hi there

I want to write a query that says "Give me the records where transaction date > #7 July 2002# and where the Status <> "PUR" or where Status <> "SET" "

I have tried all combinations, watching my brackets etc. But its not giving me what I want. Is it becasue I am mixing my NOT's and OR's is a single statement, which is confusing the logic ? But surely putting brackets will solve that problem.

Darryn

In Visual Query Language (Query Grid), try...

Where TransactionDate > 7-Jul-02

and

Where Status NOT IN ("PUR","SET")
 
Upvote 0

Forum statistics

Threads
1,221,539
Messages
6,160,412
Members
451,644
Latest member
hglymph

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top