Not Exists

W

Wes

Hi All,

I tried to run a not exists statment and Access doesn't
seem to like it. Can you tell me what is the equivlant
statment?

Wes
 
J

JL

If I understood you correctly.
You are look for records that does not exist in a list.
Try "not in" instead of "not exists".
Example,

TblAll:
Fld1 Fld2 Fld3
---- ---- ----
A 1 2
B 3 4
C 5 6

Select Fld1, Fld2, Fld3 from TblAll
where Fld1 not in ("C", "D", "E", "F");

It will return
Fld1 Fld2 Fld3
---- ---- ----
A 1 2
B 3 4
 
J

John Vinson

Hi All,

I tried to run a not exists statment and Access doesn't
seem to like it. Can you tell me what is the equivlant
statment?

Wes

Access does indeed support the NOT EXISTS clause, if you enter it
correctly:

SELECT <fields> FROM <table>
WHERE NOT EXISTS(SELECT <a single field> FROM <another table> WHERE
<criteria>);

Could you post the SQL of the query that isn't working, and the error
that you're getting?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top