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:

Some videos you may like

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.

xenou

MrExcel MVP
Joined
Mar 2, 2007
Messages
16,793
Office Version
  1. 2019
Platform
  1. Windows
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.
 

Watch MrExcel Video

Forum statistics

Threads
1,122,559
Messages
5,596,836
Members
414,107
Latest member
Tigretto

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
Top