>select personno, category, level from misshist; > where personno + dtoc(fromdate,1) in; > (select personno + dtoc(min(fromdate),1) from misshist where category = 'R' group by personno)>Is there any cleaner way to accomplish this?
SELECT personno, category, level ; FROM misshist M1 ; WHERE fromdate IN ; (SELECT MIN(fromdate) ; FROM misshist M2 ; WHERE category = "R" ; AND m1.personno = m2.personno)I don't remember offhand if this syntax works before VFP9, and I'm not at my desk to check right now.