There are several questions that you need to answer.
1) Temperature change in percentage? Percentage of what?
2) Do these cities never reach zero degrees centigrade? I've included an IIF term in the SQL to make sure that the temperature you are dividing by never goes below 1 degree, to avoid blowing up on divide by zero, and also to avoid accidentally switching signs.
Here's the table names I used - you'll change the SQL to match your table and field names.
Code:
TempReads Table name for Temperature reading table
ReadCity text - city name
ReadDate date/time - reading date
ReadMaxtemp number - temperature on that date
Start with this SQL code and then change it to match your needs.
Code:
SELECT
T1.ReadCity,
Format( (t1.ReadMaxTemp/IIF(T2.ReadMaxTemp<1,1,T2.ReadMaxTemp))-1,"00.00%" ) AS PctChange,
T1.ReadMaxTemp,
T1.ReadDate,
T2.ReadMaxTemp AS LastMaxTemp,
T2.ReadDate AS LastDate
FROM
TempReads AS T1,
TempReads AS T2
WHERE T1.ReadCity = T2.ReadCity
AND T2.ReadDate =
(SELECT Max(T3.ReadDate) From TempReads AS T3
WHERE T3.ReadCity = T1.ReadCity
AND T3.ReadDate < T1.ReadDate);
Resulting in this output:
Code:
ReadCity PctChange ReadMaxTemp ReadDate LastMaxTemp LastDate
Mumbai 25.00% 35 30-Jun-13 28 30-Nov-12
Mumbai -02.86% 34 23-Sep-13 35 30-Jun-13
New Delhi 66.67% 40 30-Jun-13 24 30-Nov-12
New Delhi -10.00% 36 23-Sep-13 40 30-Jun-13