Difference between two tables

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have two identical tables, each containing data for a given month. I would like to create a query that calculates the difference between one of the fields in the tables.

For example, each table has the following fields:
product, line, state, amount

I want the query to show me the change in amount between the two tables.
product, line, state, amount2 - amount1

TIA
 
Try something like
SELECT T1.product, T1.line, T1.[State], T1.amount - T2amount
FROM OneMonthTable As T1 INNER JOIN AnotherMonthTable As T2
ON T1.product = T2.product AND T1.line = T2.line AND
T1.[state] = T2.[state]

Hope This Helps
Gerald Stanley MCSD
-----Original Message-----
I have two identical tables, each containing data for a
given month. I would like to create a query that
calculates the difference between one of the fields in the
tables.
 
Back
Top