select Lit_LosFK, Lit_Date ; > from AI!LOSSITEM lit ; > JOIN ( ; > (select Lit_LosFK, min(Lit_Date) as min_date ; > from AI!LOSSITEM group by Lit_LosFK) dt1 ; > ON lit.Lit_LosFK = dt1.Lit_LosFK ; > AND lit.Lit_Date = dt1.min_date ; > into cursor curFIRSTLOSSPAYMENT1 nofilter >>
>>select Lit_LosFK, Lit_Date ; >> from AI!LOSSITEM ; >> where str(Lit_LosFK, 6) + dtos(Lit_Date) in ; >> (select str(Lit_LosFK, 6) + min(dtos(Lit_Date)) from AI!LOSSITEM group by Lit_LosFK) ; >> group by 1, 2 ; >> into cursor curFIRSTLOSSPAYMENT1 nofilter >> >> >>select str(Lit_LosFK, 6) + min(dtos(Lit_Date)) as TmpKey ; >> from AI!LOSSITEM ; >> group by Lit_LosFK ; >> INTO CURSOR curTemp nofilter >> >>select Lit_LosFK, Lit_Date ; >> from AI!LOSSITEM ; >> where str(Lit_LosFK, 6) + dtos(Lit_Date) in ; >> (SELECT TmpKey FROM curTemp) ; >> group by 1, 2 ; >> into cursor curFIRSTLOSSPAYMENT2 nofilter >>