• sku370870 (9/7/2012)


    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.

    All you did is add another column to the original table. You really haven't cleared anything up at all. Show us what the expected results should be. I can't figure out what you are trying to accomplish from what you have posted so far.