How Do I Add A Column in an MS Access Pivot Table That Is Calculated From The Existing Columns in the Pivot Table? - ms-access

I need help in adding a column in this pivot table that is "Minutes Per Page".
To compute for the Minutes Per Page, it should be Total Minutes (40) divided by Total Pages (20) so in the table below, the value in the Minutes Per Page column should be 2.00 and not 3.75. 3.75 is the result of Minutes divided by Pages of each individual row and not the Total. I have exhausted my resources and still can't find the answer and so again, I turn to Stackoverflow. Thank you!

I would strongly recommend avoiding building any systems reliant on MS Access Pivot Tables as this feature is deprecated and has been removed from all versions after MS Access 2010.
As an alternative, I would suggest exporting your data to Excel (or using an external data connection from within Excel linked to your Access database), and creating the pivot table there.
You can then easily create a Calculated Field as one of the standard options offered for an Excel pivot table.

Related

Include many records on one report with different values

I'm attempting to create a report in Access 2016 that resembles a bank deposit slip however I've been unable to find any way to display anything more than one record per report.
I have a query "Transactions" that sorts everything out and gives a datasheet with all the transactions to be used, the goal is to populate the report with up to around 12 different values from different transactions.
Is this even possible within access? My only thought thus far is to create a table with individual columns for each transaction, but that just seems messy.
Thanks for the help

How can I create a table that uses an equation to average data from another table?

I have a table that contains data from repeated experiments (for example, site A has one sample, and the lab processed the sample three times obtaining slightly different values). I need to average these results in a separate table, but what I have read on the Microsoft support site is that a query that pulls data into another table with a calculated field is not possible on Access.
Can I query multiple data points from one table into a single calculated field in another table? Thank you.
UPDATE
I ended up doing a lot of manual adjustments of the file format to create a calculated field in the existing table that averages each sites data, so my problem is, for my current purposes, solved. However I would still like to understand. Following up with you both, I think the problem was that I had repeated non-unique IDs between rows when I probably should have made data columns with unique variable names so that I could query each variable name for an average.
So, instead of putting each site separately on the y axis, I formatted it by putting the sample number for each site on the x-axis:
I was able to at least create a calculated field using this second format in order to create an average value for each site.
Would have there been a way to write a query using the first method? Luckily, my data set was not at all very hefty, so I could handle a reformat manually, but if the case were with thousands of data entries, I couldn't have done that.
Also, here is the link to the site I mentioned originally https://support.office.com/en-ie/article/add-a-calculated-field-to-a-table-14a60733-2580-48c2-b402-6de54fafbde3.
Thanks all.

MS Access Query: Creating a Master table from premade query that selects records with most recent date

I'm trying to make a master table in ms access that constantly updates the records of the unique model numbers based upon the most recent date.
The premade table was created by using a select query that brings all the records of multiple tables and inserts them into a single table. Within each table there are multiple fields however the only relevant fields are the Model number field and the Date. Across the tables the unique model numbers are repeated, but their individual time stamps are different.
I need the master table to select the records with the most recent date and place the whole record into the master table. I'm new to ms access and I don't know how I could do this. Any tips of suggestions would be most appreciated.
If you would need such a table then I'd say there's definitely something wrong with your database design.
Having said that, why don't you query on the most recent date of tables that hold Model Numbers?
It might help if you could elaborate on why you'd want to do this, as in why you have multiple tables that hold Model Numbers.
Maybe your current database design is open for improvement.
Kind regards,
Rene

Calculate a field's value based on multiple records in another table in Access DB

I'm trying to create a database in Access 2010, and have run into a bit of a problem. I currently have two tables, EarlyStageListResults & ESDailyTotals. Each of these tables has a field named Records, with ESDailyTotals being a summary of multiple entries in EarlyStageListResults. What I need to do is have the Records field in ESDailyTotals be the sum of multiple Records fields in EarlyStageListResults. For example, given the following records in EarlyStageListResults:
Date Records
4/22/16 2000
4/22/16 3000
4/22/16 1500
4/21/16 1200
4/21/16 2700
the records in ESDailyTotals should be:
Date Records
4/22/16 6500
4/21/16 3900
I know this can be calculated later through VBA and a form event, but optimally I'd like to be able to have it update as soon as any of the Records fields in EarlyStageListResults changes. It looks like there may be a way to do this using the Access Macro Editor (not sure of the name, but the tool where you can create a macro through a series of combo boxes rather than through VBA), but I've never gotten an understanding of using that tool, so have always relied on Forms and VBA instead. Basically if there's an event that triggers when a field is updated, and a way to enter VBA code into that event handler like you can with Access Forms, then I can do it with either DLookup or an SQL statement I think, but I don't know how to grab that event handler.
This does all need to be done within Access itself, I can't use an external program to update the records in an Access database file. This is for work, and (officially at least) any custom programs are a big no-no. :)
Thanks in advance everyone!
You're making this way too complicated. You just need one table and a database view (called a query in Access, I think) that is defined as
select Date, sum(Records) as Records from EarlyStageListResults
group by Date
Name the query ESDailyTotals.

How to create a flatfile from a series of tables in Access?

I have a series of tables in an Access 2007 database. I am trying to find a way of outputting a flat-file to an excel spreadsheet that combines all of the tables so that each row of the flatfile represents a unique combination of the table rows from each table.
For example, these tables:
Would combine to make this output table:
The challenges I'm facing are:
The 'input' tables can vary in number of rows and columns, as well as quantity
The total number of rows in the final output table can get quite large (200,000+ rows)
I know Excel and VBA (in Excel) well but almost nothing about Access
Is there a way to do this in Access? Is there some native functionality in Access that I'm completely overlooking? Any pointers (even if it's "you need to read into X and Y") would be greatly appreciated!
Thanks,
Adam
As noted above:
Create a new query. Select your 3 tables as the data sources. If desired, set up joins between tables by dragging a line between a field in one table to a field in another. Without joins you will get a Cartesian Product ... every from 1st table paired with every row of 2nd table, and then each of those combination paired with every row of 3rd table. Select the fields you want included in the result set. When the query returns what you need, save it and give it a name. Then you can export that named query to Excel.
If the table is large, you could hit Excel's row / column limit though.