>I am getting a "syntax error" when I try the above, namely
>
>
>select R.* from Ratings R INNER JOIN (select Account, max(mRating) as MaxRatingForAccount from Ratings GROUP BY Account) Mx
>ON R.Account = Mx.Account and R.mRating = Mx.MaxRatingForAccount
>
What is your VFP version?
Derived tables were added in VFP9. Prior to that you need to use 2 steps. Do the first (inner) select into a cursor and then join with that cursor.
If it's not broken, fix it until it is.
My Blog