Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 MS Access
 Inner Joints Quandary

Author  Topic 

contiw
Starting Member

4 Posts

Posted - 2006-05-03 : 23:03:48
Need help with the following MSAccess query.
After going through it for the fifthieth time I cannot see the mistake,for the life of me.

SELECT C.category_ID, C.category_Name, CT.category_count
FROM tbl_prdtcategories C
INNER JOIN tbl_products P ON C.category_ID = P.product_Category_ID
INNER JOIN (
SELECT product_Category_ID, COUNT(*) AS category_count
FROM tbl_products GROUP BY product_Category_ID ) CT ON
C.category_ID = CT.product_Category_ID
ORDER BY C.category_Name

Thank you for helping.
ContiW

PSamsig
Constraint Violating Yak Guru

384 Posts

Posted - 2006-05-04 : 02:17:47
Neither can we unless you explain what you get and what you want instead.

--
This one's tricky. You have to use calculus and imaginary numbers for this. You know, eleventeen, thirty-twelve and all those.
Go to Top of Page

contiw
Starting Member

4 Posts

Posted - 2006-05-04 : 11:32:59
quote:
Originally posted by PSamsig

Neither can we unless you explain what you get and what you want instead.


You are right PSamsig. I was in a endorphine hight at that time. The scope of the query was to list categories and products per category. After a good night of sleep I am amost there. Thanks for the interest.
ContiW
-------
"The number you have dialed is imaginary. Please rotate your phone 90 degrees and try again."
Go to Top of Page

PSamsig
Constraint Violating Yak Guru

384 Posts

Posted - 2006-05-04 : 11:37:36
LOL haven't we all :)

--
This one's tricky. You have to use calculus and imaginary numbers for this. You know, eleventeen, thirty-twelve and all those.
Go to Top of Page
   

- Advertisement -