Unmatched Query

  • Thread starter Thread starter Richardb
  • Start date Start date
Michael,

That seems to work. What is the "T." do? Thanks

Michael Gramelspacher said:
Karl,

This is not working. Can I get additional help?

Richard

perhaps:

SELECT DmList.[DM Name]
FROM DmList
LEFT JOIN (SELECT *
FROM Communications
WHERE Communications.CommDate BETWEEN CVDATE([Start Date])
AND CVDATE([End Date])) AS T
ON DmList.[DM Name] = T.[District Mgr]
WHERE T.[District Mgr] IS NULL;
 
Michael,

That seems to work. What is the "T." do? Thanks

Michael Gramelspacher said:
Karl,

This is not working. Can I get additional help?

Richard

perhaps:

SELECT DmList.[DM Name]
FROM DmList
LEFT JOIN (SELECT *
FROM Communications
WHERE Communications.CommDate BETWEEN CVDATE([Start Date])
AND CVDATE([End Date])) AS T
ON DmList.[DM Name] = T.[District Mgr]
WHERE T.[District Mgr] IS NULL;
The 'T' is an alias for the table subquery (derived table) used in place of a
table name.

I think the problem was that the WHERE clause on the joined table was making the
LEFT JOIN into an INNER JOIN. A LEFT JOIN only gets matches; you wanted the no
matches, which were no longer there after having been eliminated by the WHERE
clause on the null-supplying table.
 
Thanks Michael I really appreciate your help.

Richard

Michael Gramelspacher said:
Michael,

That seems to work. What is the "T." do? Thanks

Michael Gramelspacher said:
On Fri, 14 Mar 2008 12:32:01 -0700, Richardb

Karl,

This is not working. Can I get additional help?

Richard

perhaps:

SELECT DmList.[DM Name]
FROM DmList
LEFT JOIN (SELECT *
FROM Communications
WHERE Communications.CommDate BETWEEN CVDATE([Start Date])
AND CVDATE([End Date])) AS T
ON DmList.[DM Name] = T.[District Mgr]
WHERE T.[District Mgr] IS NULL;
The 'T' is an alias for the table subquery (derived table) used in place of a
table name.

I think the problem was that the WHERE clause on the joined table was making the
LEFT JOIN into an INNER JOIN. A LEFT JOIN only gets matches; you wanted the no
matches, which were no longer there after having been eliminated by the WHERE
clause on the null-supplying table.
 
Back
Top