Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / May 2005

Tip: Looking for answers? Try searching our database.

Variance Question

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
spartanmba - 18 May 2005 22:20 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.