473,387 Members | 1,721 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

can't get unmatched query to work.

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

Mar 21 '07 #1
5 2855
On Mar 21, 11: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
did you try to use the unmatched query wizard? start with that, and
create any additional joins/filters as needed

Mar 21 '07 #2
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

Mar 21 '07 #3
legend - thanks a million!

Mar 22 '07 #4
Basically I wanted to say thanks for the help and see if you could
point me in the right direction on my next problem - . Basically its
in the same system, once I applied the query you helped me with I
spotted a flaw in my system. Some suppliers provide both drystone and
asphalt, as such if a supplier had only submitted a drystone quote the
query assumes that they have also submitted an asphalt quote (some
companies run the 2 as separate departments as such one may arrive and
not the other etc)

I've added 2 yes/no fields to the quotes file, to indicate what has
been quoted (dry and asphalt) however when I try to display them in
the query I get a grayed out box rather than a tick or an empty box
despite having filled them in on the quotes file which the query draws
from. Also I'm assuming I can modify the query you gave me to look at
the tick box and the quote number in relation to similar tick boxes in
my supplier table that indicate which stone types they provide? i.e
to modify my query to find sites suppliers haven't quoted for to one
which displays sites that haven't got a dry/asphalt part to the quote
where the company can supply such a material.

The supply will always be one or the other or both - i don't need any
future flexibility in terms of categories. in terms of the suppliers
probably over 50% offer both services and the rest just offer dry
stone. however they may be unable to quote for one or the other
depending how far the site is from their plants. as such just because
a supplier can supply in theory, practice they may not quote. as such
it would be beneficial if i can insert a field somewhere to say that
the suplier can't quote due to location etc so that they are ommited
from the main query and i don't keep pestering them for a quote that
they can't provide.

Mar 27 '07 #5
On 27 Mar, 02:25, themastertay...@hotmail.com wrote:
Basically I wanted to say thanks for the help and see if you could
point me in the right direction on my next problem - . Basically its
in the same system, once I applied the query you helped me with I
spotted a flaw in my system. Some suppliers provide both drystone and
asphalt, as such if a supplier had only submitted a drystone quote the
query assumes that they have also submitted an asphalt quote (some
companies run the 2 as separate departments as such one may arrive and
not the other etc)

I've added 2 yes/no fields to the quotes file, to indicate what has
been quoted (dry and asphalt) however when I try to display them in
the query I get a grayed out box rather than a tick or an empty box
despite having filled them in on the quotes file which the query draws
from.
Are your other fields showing up in the query from the same table that
has the yes/no fields?
>Also I'm assuming I can modify the query you gave me to look at
the tick box and the quote number in relation to similar tick boxes in
my supplier table that indicate which stone types they provide? i.e
to modify my query to find sites suppliers haven't quoted for to one
which displays sites that haven't got a dry/asphalt part to the quote
where the company can supply such a material.
There's 2 ways to do this. One would be your approach. Which is okay
if that's the only 2 stone types you'll ever deal with. (If there
would be multiple types, you may have wanted to consider putting them
in a related table.)
The supply will always be one or the other or both - i don't need any
future flexibility in terms of categories. in terms of the suppliers
probably over 50% offer both services and the rest just offer dry
stone.
The yes/no column, vs. the related table for supply types is going to
play into how you want your system to act. If you really want to know
and deal with separate quotes on your "didn't quote" page, then you'll
likely need to do a related table anyway. The only way around it is
if you can tolerate showing companies on the "not quoted yet" list
which have one service quoted, but not the other.
>however they may be unable to quote for one or the other
depending how far the site is from their plants. as such just because
a supplier can supply in theory, practice they may not quote. as such
it would be beneficial if i can insert a field somewhere to say that
the suplier can't quote due to location etc so that they are ommited
from the main query and i don't keep pestering them for a quote that
they can't provide.
Yes, what you really want to do is create the ability to log a "no-
quote" in your table "quote" file. You might also want to put a
reason there. And, if you're doing a "yes/no" method, you'll want to
have 2 no quote fields for each type of rock.

This isn't really "perfect" database theory, but in your case, since
you have a known dataset of rules, you'll be fine.

Try setting up multiple queries for each condition first. At
first ,it will be fine for you to have 2 separate queries - one that
shows dry rock not quoted. And one that shows asphault rock not
quoted. You'll learn based on that what your "or"/"and" selections of
"WHERE" statements can look like to do a combined query.

Jon

Mar 27 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Colleyville Alan | last post by:
I want to extract some records that are common to three tables, but not contained in the fourth. Following what I have see in the archives and also trying the unmatched records query wizard, if I...
3
by: Richard Coutts | last post by:
I have a query created by the "Find Unmatched" query that lists items in a table that were not selected by another query. The Query does what it needs to do, but I can't edit any of the resulting...
3
rcollins
by: rcollins | last post by:
I have two tables that I am working on here, tblClientContact and tblClientFunding. I made a query from tblClientFunding that pulls out only the current funding available. I need to match this up...
2
by: scolivas | last post by:
Is there a way to automate this process? I have a query that finds the "Drop Offs" by doing an unmatch query against the hard table and the live table. I want to automatically pull these...
2
by: flipperqm | last post by:
I have 2 queries with alot of data but when i run the find unmatched query wizard, i tell it which 2 queries but when it asked me to tell it which 2 fields to match, it doesn't show any fields . They...
2
by: ilikebirds | last post by:
In 1 Database(ttt) I currently have a Union Query that collects data from 4 databases (a,b,c,d) and then a MakeTable query that combines all of those into a table. ( Union A,B,C,D to make table in...
1
by: AccessHunter | last post by:
Please Help.... I have a query with 2 tables, LegalFile and Cases. LegalFile has the field CaseID(Number Field) and Cases has CaseNbr(Text Field). I am trying to find entries that are in...
1
by: Tlou5831 | last post by:
I am attempting to compare 2 tables in my DB and find unmatched criteria. There are 2 different fields in each database that need to be compared. Tbl_AppUsers Role Settings INQ ...
2
by: zufie | last post by:
Does MS Access utilize something like a backlash (\) to make the following SQL code work? (SQL uses a backlash (\) to make the following SQL code work). Here is my code: INSERT INTO...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.