Select policy, exp_mod, eff_date ; from mytable mt1 ; WHERE NOT EXISTS ( ; SELECT * FROM mytable mt2 ; WHERE mt2.policy = mt1.policy AND mt2.eff_date > mt1.eff_date) ; into cursor xxx * or Select policy, exp_mod, eff_date ; from mytable mt1 ; WHERE eff_date = ( SELECT MAX(eff_date) FROM mytable mt2 ; WHERE mt2.policy = mt1.policy) ; into cursor xxx>I have a table with 3 fields - policy number, exp_mod, eff_date. There are many records for each policy number.
>Select policy,exp_mod,max(eff_date) from table exp_mod_table ; >group by policy,exp_mod into cursor xxx > >>