Xenix
02-06-2002, 02:29 AM
I have two tables, One Company details and another which is Business Sector, there can be multiple Business sectors for a company so I use this method and link with company name. I want to generate a report with only the companies that have no business sector filled in?? Can anyone help me??
when I have tried to create a query it only shows the records that have the Business sector filled in?
Help help would be greatly appreciated
Mike
helenpostle
02-06-2002, 02:39 AM
change the criteria of the business sector field to is null, then it should only show the records with no value in business sector
Xenix
02-06-2002, 02:41 AM
Thank you, If I do that is shows no records, I think this is due to the table Business sector, it only has the company name in it if there is a Business sector http://www.access-programmers.co.uk/ubb/frown.gif
any other advice?
Pat Hartman
02-06-2002, 04:27 AM
You also need to change the join type to Left.
Select C.CompanyId, C.CompanyName
From tblCompany As C Left Join tblBusinessSector As B On C.CompanyId = B.CompanyId
Where B.BusinessSector Is Null;
Xenix
02-06-2002, 05:26 AM
Thank you Pat http://www.access-programmers.co.uk/ubb/smile.gif)
that worked fine http://www.access-programmers.co.uk/ubb/smile.gif
Regards
Mike