Hi Folks, Thanks for all your replies.
I thought I would keep it simple by showing a sample where there were
just two fields... in reality there are more than the two fields.
I note that there is a different solution if there are more than 2 fields !!!
I'll take that into account.
Thanks again
Regartds.
Gerard
>>I have a table as follows with 2 columns :
>>CUS Date (Date field)
>>A 10 May
>>A 12 May
>>A 14 May
>>B 6 Jan
>>B 9 JUN
>>B 20 DEC
>>
>>Is there a Sql select which will select out all customers but with most recent date only
>>So I would require:
>>A 14 May
>>B 20 Dec only
>>
>>Tia
>>Gerard
>
>If you want to get ALL fields (or at least more than just these two) from that table for most recent date, and if you have MORE than just Customer and Date field:
>
>SELECT YourTable.*;
>FROM YourTable;
>INNER JOIN (SELECT Cus, MAX(DATE) AS Date;
> FROM YourTable;
> GROUP BY Cus) Tbl1;
> ON YourTable.Cus = Tb1l.Cus AND
> YourTable.Date = Tbl1.Date;
>INTO CURSOR crsTest
>BROWSE NORMAL
>