Apologies, I was modifying my first post when I thought - that will just confuse the issue. Can we start again please?
CREATE TABLE #tblBlocks
(
TemplateID int,
BlockID int,
FieldID int,
BaseStage bit
)
GO
INSERT INTO #tblBlocks (TemplateID, BlockID, FieldID, BaseStage)
SELECT 1, 1, 1, 0 UNION ALL
SELECT 1, 1, 2, 0 UNION ALL
SELECT 1, 1, 3, 0 UNION ALL
SELECT 1, 2, 4, 0 UNION ALL
SELECT 1, 2, 5, 1 UNION ALL
SELECT 1, 2, 6, 0
GO
--SELECT * FROM #tblBlocks
DROP TABLE #tblBlocks
If I join to the Table above on TemplateID - I need it to return nothing if any BlockID group does not contain a BaseStage of 1.
Sorry for screwing up.