>>1.- Select city,date,Max(temp) from yourtable order by city group by city,date
>>Juan C.
>
>This select would return date from last physical record for each city not date corresponded to Max(temp).
No. This SQL statement would return the maximum temp recorded for each city for each day. If you only had 1 recorded temp per day, it would return all records in the table.
Because extraneous inforamtion is needed that shouldn't be included in the GROUP BY clause (Date), you have to go with 2 SQL statements: one to store the city and maxiumum temp in a cursor and then one to use that result to join against to retrieve the other information as Trey suggested.
Larry Miller
MCSD
LWMiller3@verizon.netAccumulate learning by study, understand what you learn by questioning. -- Mingjiao