>>>Larry is not saying that you will get the wrong temperature for each city; he is saying that your query will tell you the wrong DATE for that temperature. Just looking at your query, I would think the date would be incorrect, unless
>
>You're right. I was home last night thinking about this problem, trying to figure out why it seemed like I got the right answer, but wasn't suppose to. Then it hit me, that I'm getting the right temp (after all, max(temp))
>but getting the wrong record back. Two very distinct things! And that just won't do!
>Nice catch, thanks for the help,
>
>Dustin
Dustin,
No problem.
I've been burned by how VFP handles aggregates and GROUP BY clauses a number of times. It should generate an error as SQL Server does when you include fields in the SELECT that are not also included in the GROUP BY. The query engine is too lax (IMO).
Cheers!
Larry Miller
MCSD
LWMiller3@verizon.netAccumulate learning by study, understand what you learn by questioning. -- Mingjiao