>Wow!. No, I meant, for the entire table, which has years 2011 through 2013, and which has multiple accounts, for all of this--- show the maximum
>rating, in any of these years, that each account received, from 2011 through 2013. And, for the same time period,
>show THE which in month, each account logged its maximum rating. I hope this is possible. Thank you!!
>Steve
Can you please formulate again your request? May be show the desired output?
To show maximum rating for each account and know which year (and month) that rating was achieved is slightly more complex problem and can be solved with derived table in VFP, e.g.
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
The above may return more than 1 row per account if the account has same max ratings in different year/month/hour/15 minutes interval
If you need just one row (doesn't mean which one) and you have ID column in your table, then this can be solved by creating composite max key....
If it's not broken, fix it until it is.
My Blog