This query is being run on MSAccess 2002.

I want to do a LEFT OUTER JOIN so that all company names are returned
based on a product CATEGORY, even though they may not have a product
BRAND associated with them. (I used a joining table, pl_join, because
one company may have many brands; the pl_joincatbrand table is used as a
joining table because one brand may belong to many categories).

The query statement below works properly, but will not bring back
company names that do not have a brand.  I've tried a number of ways to
do a LOJ in the FROM statement, but I can't get it to work where there
are more than two tables involved. (ie, FROM pl_companies LEFT OUTER
JOIN pl_join ON pl_companies.pl_ID = pl_join.pl_ID)

Your help is greatly appreciated, as my head is getting really sore
banging it on the desk for the past 7 hours trying to get this to work
right.

Mark
================================

SELECT *        
FROM pl_category, pl_join, pl_companies, pl_joincatbrand, pl_brands
                        
WHERE pl_category.prl_cat_ID = #FORM.prl_cat_ID# AND 
        pl_category.prl_cat_ID =  pl_joincatbrand.prl_cat_ID AND 
        pl_Brands.pl_BID = pl_joincatbrand.pl_BID AND 
        pl_Brands.pl_BID  = pl_join.pl_BID AND 
        pl_join.pl_ID = pl_companies.pl_ID

ORDER BY pl_companies.co_name ASC

Thanks,
Mark

______________________________________________________________________
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to