Re: Union query



thank you

"John Spencer" wrote:

The following query should give you every jack that doesn't have a match in
the Directory table - based on Jack,
bldg Desc, and Room being an EXACT match.

SELECT Jacks.[Bldg Desc], Jacks.Floor, Jacks.Room,
Jacks.Jack, Jacks.[Bldg Num]
FROM Jacks LEFT JOIN Directory
ON Jacks.[Bldg Desc]=Directory.[Bldg Desc]
AND Jacks.Room=Directory.Room
AND Jacks.Jack=Directory.Jack
WHERE Directory.[Bldg Desc] is Null
AND Directory.Room is Null
AND Directory.Jack Is Null
ORDER BY Jacks.[Bldg Desc], Jacks.Floor, Jacks.Room, Jacks.Jack;



"EdLeeYoung" <EdLeeYoung@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:C94E8AFF-4F63-4105-97C0-BB29303FA964@xxxxxxxxxxxxxxxx
Here's my queries...don't know which is correct. I want every
Jack,building,room combo from my Jack Table that is not listed in my
Directory
Query 1 gives me 3924 reponses
Query 2 gives me 4186 reponses
Query 1 contains "WHERE (((Directory.Jack) Is Null))"
Query 2 does not
I don't know whaty "WHERE (((Directory.Jack) Is Null))" does...I saw it
online on a help page.


SELECT Jacks.[Bldg Desc], Jacks.Floor, Jacks.Room, Jacks.Jack, Jacks.[Bldg
Num]
FROM Jacks LEFT JOIN Directory ON (Jacks.[Bldg Desc]=Directory.[Bldg
Desc])
AND (Jacks.Room=Directory.Room) AND (Jacks.Jack=Directory.Jack)
WHERE (((Directory.Jack) Is Null))
ORDER BY Jacks.[Bldg Desc], Jacks.Floor, Jacks.Room, Jacks.Jack;


SELECT Jacks.[Bldg Desc], Jacks.Floor, Jacks.Room, Jacks.Jack, Jacks.[Bldg
Num]
FROM Jacks LEFT JOIN Directory ON (Jacks.[Bldg Desc]=Directory.[Bldg
Desc])
AND (Jacks.Room=Directory.Room) AND (Jacks.Jack=Directory.Jack)
ORDER BY Jacks.[Bldg Desc], Jacks.Floor, Jacks.Room, Jacks.Jack;




"John Spencer" wrote:

Build the query with the find unmatched query on one of the fields
Then modify the query by joining on the other fields. The join should be
in
the same direction (and same type) as the one that the wizard built.
Now add the IS Null criteria under each of the joining fields in the same
table as the wizard used.

If you can't do that, post the SQL (text view) and tell us which fields
you
want to join on and someone should be able to modify the SQL statement
for
you.

"EdLeeYoung" <EdLeeYoung@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:0466AF4C-BCD8-4674-B3A5-791226C1AB95@xxxxxxxxxxxxxxxx
The Find Unmatch Query Wizard is no good unless you are comparing one
(1)
field in each table. The key field I need to compare is four (4)
fields.

"Marshall Barton" wrote:

EdLeeYoung wrote:

I need a query but don't know how to word it.
I have two tables PhoneJacks and People. The PhoneJack table has
JackNum,
Bulding, and RoomNum as it's Key Field (the People table contains
those
fields as well as other person related fields).

How do I get everything in the PhoneJack table that is not found in
the
People table? Everything I have tried has given me wrong results.


The Find Unmatch Query Wizard should be able to guide
through creating an appropriate query.

--
Marsh
MVP [MS Access]







.



Relevant Pages

  • Re: simple SunBlade 1500 external question
    ... Are there commands to query for this ... > only, dvd and one of the writable formats, etc. ... Up front you get two USB 1.1 ports, a headphone jack, and a microphone ...
    (comp.unix.solaris)
  • Re: tempdb grows to 8G suddenly
    ... Jack ... > to someone running a query which has a join that has not been qualified ... a huge result set gets built up (in tempdb ... >> Regards, ...
    (microsoft.public.sqlserver.server)
  • Re: Union query
    ... the Directory table - based on Jack, ... Query 1 gives me 3924 reponses ... the same direction as the one that the wizard built. ... The PhoneJack table has ...
    (microsoft.public.access.queries)
  • RE: Link to Office Word 2003
    ... Is it possable to export data in a field to a word doc., such as names, ... "Jack" wrote: ... > Is there a way of sending the results of a query to a Word mailmerge ...
    (microsoft.public.access.gettingstarted)
  • Re: Help with Max Date please ...
    ... SELECT Max(SalaryData.Dat), ... Jack ... >> where there may be duplicate records with different dates. ... The query below shows me all the records - including the ...
    (microsoft.public.access.queries)

Quantcast