MicroSoft Access Monthly Sums

stanlkathy

New Member
Joined
Dec 10, 2009
Messages
10
I have created an extensive database of over 100K records extracting production volumes from TOW as daily. Each daily volume has an associated Equip_SK and Equip_Name for the timeframe 1/2008 to current.



Equip_SK EquipName Month Day Year Volume
180047 Well #1 1 1 2008 345
180047 Well #1 1 2 2008 678

How do I tell Access to calculate dailys to monthly and 12 month total by Equip_SK and EquipName? Thank you kindly,

Kathy Stanley
 
Last edited by a moderator:

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
I think this query would group by Month, using the month end date:
Code:
SELECT
	Table1.Equip_SK, Table1.EquipName, 
	DateSerial(Table1.[Year], Table1.[Month] + 1, 0) As Period_Ending, 
	SUM(Table1.Volume) As SumOfVolume

FROM Table1

GROUP BY 
	Table1.Equip_SK, 
	Table1.EquipName, 
	DateSerial(Table1.[Year], Table1.[Month] + 1, 0)


And this would group by Year:
Code:
SELECT
	Table1.Equip_SK, 
	Table1.EquipName, 
	Table1.[Year], 
	SUM(Table1.Volume) As SumOfVolume

FROM Table1

GROUP BY 
	Table1.Equip_SK, 
	Table1.EquipName, 
	Table1.[Year]

Note: Next time you build a table, prefer not to use column names Year, Month, Day - these are the names of functions in Access. Putting them in brackets will help Access to catch on better.
 
Upvote 0

Forum statistics

Threads
1,214,891
Messages
6,122,105
Members
449,066
Latest member
Andyg666

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top