>Cetin,
>
>Yes I tested the code (and thank you for the time you put into it) but I kept getting a 'function error' on running it. What I've done since then is dropped the parent relationship and for the moment am just trying to retrieve, from one table, the latest (in date order) referral record for any MNO as per the example. Once I have that sorted we can go back to working on the parent/child model
>
>Hope you are well - do you actually live in Turkey by the way?
Hi Bob,
First SQL on child consists of selecting most recent dates :
select mno, max(refdate) from referrals ;
into cursor myCursor ;
group by mno
select mno+dtos(max(refdate)) from referrals ;
into cursor myCursor ;
group by mno
select * from main ;
left join referrals ;
on main.mno = referrals.mno ;
where referrals.mno + dtos(referrals.refdate) in ;
( select mno+dtos(max(refdate)) from referrals ;
group by mno ) ;
into cursor myCursor
Hope this does it.
Yes, I do live in Turkey and never been abroad :) BTW why?
Cetin