View Single Post
  #9  
Old February 20th, 2007, 12:51 AM posted to microsoft.public.access.queries
John Spencer
external usenet poster
 
Posts: 2,364
Default searching for similar records

Try dropping the join on the part number also. I must admit, I am a bit
baffled on exactly what you want returned.

After reviewing this thread, it seems that you want all parts bought by
a customers (or customers) that have bought a particular part as long as
the parts are within 10 percent of the cost and the cable and the bom
and the time.

So if I bought part no 52, what other parts did I buy that were within
10 percent of the cost and the bom and the time and the cable. Whatever
those are. If that is correct then you probably only want to join on
the customer and use criteria on the other items. You don't want to do
anything at all with criteria or joins on partnumber.



'================================================= ===
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
'================================================= ===


Maax wrote:
John, i removed link but still the same. i have tried taking out all of the
between criteria and replacing the price criteria with a between 5 and 200.
This should return many records but still only returns the record that has
the same part number i enter for the search.

I will continue to play around with it but its a little beyond me i am afraid.

many thanks for your help

"John Spencer" wrote:

No, you do not want to link by the primary key field. That is probably what
is restricting your results to one record. REmove that link by
right-clicking on it and selecting delete.

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..

"Maax" wrote in message
...
Hi John, i am following your instructions (i think) but when i run the
query
the only record returned is the one that i entered as the part number. It
is
not returning other parts that are within the criteria.
I will have a play with it and hopefully something will click into place.
One question i do have, should only the partnumber and customer be linked?
These are linked but also the unique ID(key) from the table is linked.

regards Max



"John Spencer" wrote:

It sounds as if you are using the query design view (the query grid) to
build your queries.

Open a new query
-Select your table
-Click close
-Add the fields to the query grid
-under part number enter
= [What Part]

Save this query as qPartMatch.

Open a new query
-- Select your table
-- Click on the query tab
-- Select the saved query
-- Click close
-- if there is no join line between partNumber and PartNumber Drag from
the
table to the query
-- if there is no join line between Customer and customer drag again
-- Add the fields you want from the table
-- in the criteria under the relevant fields you will have to type
BETWEEN [qPartMatch].[BOM] *.9 And [qPartMatch].[BOM]*1.1

Alternative is to copy the proposed SQL statements into the SQL view of
the
query and edit the table (and field) names. Save the first as noted.

Now copy the second one as posted and change the table name again.

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..

"Maax" wrote in message
...
Hi John, many thanks for reply.
I have a minor problem, i am very novice and although i can create
basic
queries i am unsure where to enter the following,

SNIP