• Instead of using union all etc, rather consider using joins:

    select PntKey,

    #Parent.PntQty Qty,

    #Child1.Cd1FromDate FromDate1,

    #Child1.Cd1ToDate ToDate1,

    #Child2.Cd2FromDate FromDate2,

    #Child2.Cd2ToDate ToDate2

    FROM #Parent

    LEFT JOIN #Child1 ON #Child1.Cd1PntKey = #Parent.PntKey

    LEFT JOIN #Child2 ON #Child2.Cd2PntKey = #Parent.PntKey

    ____________________________________________
    Space, the final frontier? not any more...
    All limits henceforth are self-imposed.
    “libera tute vulgaris ex”