>If no aggregate function ise used (e.g. SUM, COUNT) then VFP will return the value contained in the last record physically in the table that adheres to the GROUP BY clause. As Marek suggested, use the MAX function to return the highest date in the group:
>SELECT MASTER.MASTERKEY,MAX(CHILD.DATE) AS CHILDDATE FROM CHILD;
> INNER JOIN MASTER ON CHILD.MASTERKEY=MASTER.MASTERKEY;
> GROUP BY CHILD.MASTERKEY ORDER BY CHILD.DATE DESCENDING;
> INTO CURSOR TEMP
>This will return:
>
>000001 01/01/2000
>000002 01/01/2000
Thanks, that works.