Query Table - John Spencer

D

Dustin B

This post is in reference to a post I made previously "Querying a Table"

I used the below SQL to find all MasterFiles in a table where the CAD for
each occurance of that Master File has CAD set to True. The SQL was posted
by John Spencer. The querry worked the first time I ran it. After that is
said there was a problem with the join. So I would copy the code back into
the window and it ran again only to fail the second time it ran. Now it
won't run at all. I have tried to figure out why it is not working by
changing field names and manually linking the tables in design mode but it is
still busted. Below is the error I get now.

"The Microsfot Jet database engine cannot find the input table or query
'Select MasterFile FROM tbTempOfContInfo WHERE CAD = False'. Make sure it
exists and that its name is spelled correctly."

Current SQL in the querry.

SELECT A.MasterFile
FROM tblTempOfContInfo AS A LEFT JOIN [SELECT MasterFile FROM
tblTempOfContInfo WHERE CAD = False] AS B ON A.MasterFile=B.MasterFile
WHERE B.MasterFile is Null;
 
K

KARL DEWEY

You have brackets where you need parenthesis.
SELECT A.MasterFile
FROM tblTempOfContInfo AS A LEFT JOIN (SELECT MasterFile FROM
tblTempOfContInfo WHERE CAD = False) AS B ON A.MasterFile=B.MasterFile
WHERE B.MasterFile is Null;
 
P

peg collins

Dustin B said:
This post is in reference to a post I made previously "Querying a Table"

I used the below SQL to find all MasterFiles in a table where the CAD for
each occurance of that Master File has CAD set to True. The SQL was
posted
by John Spencer. The querry worked the first time I ran it. After that
is
said there was a problem with the join. So I would copy the code back
into
the window and it ran again only to fail the second time it ran. Now it
won't run at all. I have tried to figure out why it is not working by
changing field names and manually linking the tables in design mode but it
is
still busted. Below is the error I get now.

"The Microsfot Jet database engine cannot find the input table or query
'Select MasterFile FROM tbTempOfContInfo WHERE CAD = False'. Make sure it
exists and that its name is spelled correctly."

Current SQL in the querry.

SELECT A.MasterFile
FROM tblTempOfContInfo AS A LEFT JOIN [SELECT MasterFile FROM
tblTempOfContInfo WHERE CAD = False] AS B ON A.MasterFile=B.MasterFile
WHERE B.MasterFile is Null;
 

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