Can't get my head around this one and I'm wondering if all the smart SQL guys out there can help me?
I need to select opportunities from a table only if there is no quote with a 'TRUE' condition. Each opportunity can have many quotes.
Below is the query I'm using [dbo.Quotes.quot_master is the true/false test] but this query returns some incorrect entries.
So, to summarise, I need the query to return all of the Opportunities only where all of the attached quotes are quot_master = NULL.
Can you help please?
Text
SELECT TOP (100) PERCENT dbo.Opportunity.oppo_ref AS 'Opportunity Reference', dbo.Company.Comp_Name AS 'Company Name', dbo.Company.Comp_Status AS 'Company Status', dbo.Company.Comp_Type AS 'Company Type', dbo.Opportunity.Oppo_Description AS 'Opportunity Description', dbo.Opportunity.Oppo_Stage AS 'Opportunity Stage',...