Two INNER JOIN, WHERE balks on first INNER JOIN

  • Thread starter Thread starter Guest
  • Start date Start date
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];
 
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
 
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]?
 
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
 
Back
Top