On Mar 21, 10:50 am, themastertay...@hotmail.com wrote:
I've got a system to manage various quotes for building materials for
a number of sites. i want a query to produce a report that shows me
who HASN'T quoted for which sites. basically so i can print it off and
ring round and hurry them up a bit. I have my quote table which has
the supplier ID, Site ID and an ID for each quote.(I enter each quote
and specify which supplier and site it relates to. I've tried an
unmatched query but can't get it to output correctly. i think i need
some sort of expression to basically say "if there is a site ID,
return all results where one or more supplier IDs isn't attributed to
that site ID" any help would be great
Here's how I do this(substitute supplier=quoter and site=job
below)...
If I understand it right, you have 3 tables...
tblQuoter - The query of the of active quoters for a job.
tblJob - Is a list of open jobs to be quoted.
tblQuote - Is the list of quotes
So, you set up 2 queries. The first, qryQuotersAndJobsCombined gives
you all of the possible combination of open Jobs and active Quoters.
SELECT tblJob.*, tblQuoter.*
FROM tblJob, tblQuoter
WHERE (((tblJob.open)=Yes) AND ((tblQuoter.active)=Yes));
(To set this up, you set both tables in the query, without a
relationship. Drag the "*"'s down so you'll have all the fields from
both tables, and then drag the "open" and "active" fields, but uncheck
the "Show" boxes.")
(Note, if only certain Jobs are available to certain quoters, then
this query will also need to incorporate the related
"tblQuoterCapabilities" also.)
The second, qryNullQuotes gives you all of the combinations which have
no quote.
SELECT tblQuote.*, [qryQuotersAndJobsCombined].*
FROM [qryQuotersAndJobsCombined] LEFT JOIN tblQuote ON
([qryQuotersAndJobsCombined].Quoter = tblQuote.QuoterName) AND
([qryQuotersAndJobsCombined].Job = tblQuote.JobName)
WHERE (((tblQuote.QuoteID) Is Null));
(Put tblQuote and qryQuotersAndJobsCombined as the 2 query tables.
Set up the "LEFT JOIN" by dragging and dropping both related keys on
each other. On each relationship line, right click to edit them show
"all" form the query, and only those fields that match from the
table. Again, drag both "*"'s down so you get all fields. Then, drag
down the QuoteID field, uncheck the "Show" box, and type in "Is Null"
to limit the answers to those jobs that are Null.)
Hope that helps/makes sense.
Jon