Bill:
I want to EXCLUDE the other records. I think Boris is on the right track.
Thanks,
Yossi
>SELECT TOP 1. price FROM foo ORDER BY date DESC
>will give you the latest price.
>
>
>>Hi All:
>>
>>Consider
>>
>>
>>Item# Date Price
>>1111 2/3/04 111.22
>>2222 2/3/05 111.22
>>3333 2/3/06 111.22
>>4444 2/3/07 111.22
>>1111 2/3/08 222.22
>>
>>Select Item, max(date), Price ;
>>from foo ;
>>group by item ;
>>into cursor boo
>>
>>
>>I want the latest price, so this would be the result:
>>
>>
>>Item# Date Price
>>2222 2/3/05 111.22
>>3333 2/3/06 111.22
>>4444 2/3/07 111.22
>>1111 2/3/08 222.22
>>
>>
>>Problem is that VFP doesn't like this and generates an error GROUP BY clause missing. How do I solve this?
>>
>>Thanks,
>>
>>Yossi