cross-referencing in a query

B

backintheday

I've been finding resolutions to many of my Access problems here for quite
some time. Thank you :)
However, I couldn't find a resolution for my current issue, so I apologize if
it addressed elsewhere.

BTW, hold on to something, this one is confusing.


I have two fields within the same table that need some sort of cross-
referencing. See example below...

product_name , store_name
-----------------------------------------
soapA , store1
soapB , store1
towelA , store2
towelB , store2
slipperA , store3
slipperA , store3
-----------------------------------------

soapA and soapB are identical items but named differently - as are the
towels; but I need to be able to select the names of stores wherever they may
include each soap or towel with different names but not stores with the
slippers because they have the same exact name. store3 should not be
returned, only store1 and store2.

Yeah, I know. I have a headache too.
 
K

KARL DEWEY

Try this --
SELECT Backintheday.product_name, Backintheday.store_name,
Count(Backintheday.store_name) AS CountOfstore_name
FROM Backintheday
GROUP BY Backintheday.product_name, Backintheday.store_name
HAVING (((Count(Backintheday.store_name))<2));
 
B

backintheday

Most excellent! The results were exactly what I was looking to achieve.
Only the corrrect stores were returned. And such a quick response :)

Muchas gracias.

Perhaps only I was confused... in my own head... somewhere.

KARL said:
Try this --
SELECT Backintheday.product_name, Backintheday.store_name,
Count(Backintheday.store_name) AS CountOfstore_name
FROM Backintheday
GROUP BY Backintheday.product_name, Backintheday.store_name
HAVING (((Count(Backintheday.store_name))<2));
I've been finding resolutions to many of my Access problems here for quite
some time. Thank you :)
[quoted text clipped - 23 lines]
Yeah, I know. I have a headache too.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top