Two INNER JOIN, WHERE balks on first INNER JOIN

G

Guest

SELECT [App Info].[First Name], [App Info].MA, [App Info].[Last Name], [Class
Info].Date
FROM ([App Info] INNER JOIN [Class Info] ON [App Info].[Soc Sec #] = [Class
Info].[Soc Sec])
INNER JOIN [Desired Work] ON [App Info].[Soc Sec #] = [Desired Work].[Soc
Sec];


The above works, returning the four values that I asked for. But the
following doesn't work -- notice that the only change is a WHERE clause in
the first INNER JOIN

SELECT [App Info].[First Name], [App Info].MA, [App Info].[Last Name],
[Class Info].Date
FROM ([App Info] INNER JOIN [Class Info] ON [App Info].[Soc Sec #] = [Class
Info].[Soc Sec]
WHERE [Class Info].[Class Name] = "Qualified Applicant Exam")
INNER JOIN [Desired Work] ON [App Info].[Soc Sec #] = [Desired Work].[Soc
Sec];
 
T

Tom Ellison

Dear Banaticus:

The WHERE clause goes after all the JOINs:

SELECT [App Info].[First Name], [App Info].MA,
[App Info].[Last Name], [Class Info].Date
FROM ([App Info]
INNER JOIN [Class Info]
ON [App Info].[Soc Sec #] = [Class Info].[Soc Sec])
INNER JOIN [Desired Work]
ON [App Info].[Soc Sec #] = [Desired Work].[Soc Sec]
WHERE [Class Info].[Class Name] = "Qualified Applicant Exam";

Tom Ellison
 
G

Guest

Thanks. It seems also that only 256 or so characters can go in a Where
statement? Is there a way to make a condition shorter, putting in [*stuff"
instead of "[prestuff] AND [newstuff]?
 
P

Philipp Stiefel

Thanks. It seems also that only 256 or so characters can go in a Where
statement?

There is no such limit in general. You should be more
specific as to where you're experiencing this issue.
Is there a way to make a condition shorter, putting in [*stuff"
instead of "[prestuff] AND [newstuff]?

The only general approach is to use aliases for the
tables, as Sylvain already mentioned. - There may be
other ways to "shorten" specific criteria expressions
depending on you query and desired results but there
is no general solution.

Cheers
Phil
 

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