Variance Question

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

Guest

I have one table that has sales results for 2 quarters. The results for one
quarter are stored in one row and the results for the second quarter are in
another. How can I combine the quarters to create a "variance query". My
data looks like

Quarter Month Sales
1 5 75
2 5 79

I just want to have something that takes (79 - 75). Thanks so much. I
think I should use a UNION, but just not sure.

Thanks again,
John
 
Hi,



SELECT a.quarter, a.[Month], a.sales, a.sales-b.sales As Change
FROM myTable As a LEFT JOIN myTable As b
ON a.[Month]= b.[Month] AND a.Quarter = b.Quarter +1



Hoping it may help,
Vanderghast, Access MVP
 
Back
Top