select ; cl_ref as Ref_CL, min(EVL(re_date, {^9000-12-31})) as dMin, {..} as dGoMonth from referral ; where re_date<>{..} ; && Dunno if this clashes with your business case if only checked here - think about it group by 1 ; into cursor T_Border readwrite && probably the worst place, but gives you a baseline to compare different approaches ! replace all dGoMonth with GOMONTH(dMin, -216) in T_Border select * ; from person ; join T_Border ; on cl_ref = Ref_CL and cl_dob > dGoMonth *-- or select * ; from person ; join T_Border ; on cl_ref = Ref_CL where cl_dob > dGoMonth *-- or select * ; from person ; join T_Border ; on cl_ref = Ref_CL where cl_dob > GOMONTH(dMin, -216) && substract time for replace here <g> *-- or select * ; from person ; join T_Border ; on cl_ref = Ref_CL where cl_dob + 1 > dGoMonth +1 && surely rushmore turned off here ! *-- or select *, dGoMonth ; from person ; join T_Border ; on cl_ref = Ref_CL having cl_dob > dGoMonth & second step for second step - doesn' t look good, but try anywaythis is a two step process - I hope I haven't overlooked a reason for your 3 Table join..