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
Michel Walsh - 19 May 2005 11:36 GMT
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
>I have one table that has sales results for 2 quarters. The results for
>one
[quoted text clipped - 12 lines]
> Thanks again,
> John