Calculated fields in Access
I have a tabular form with a list of records from a specified po number. I am trying to figure out how to total those records. I did the basic
=[Quantity]*[Unit Price] but it only shows the total of the first record instead of all the records. Anyone have any ideas :confused:
# 1 Re: Calculated fields in Access
in acces build a query and as an advanced criteria you can select to sum it all
so i would build a calculated field in a query and sum that
# 2 Re: Calculated fields in Access
the problem there is that I need alot of different sums. Basically some purchase orders have 5-10 records. I dont want to sum up all of the purchase orders but create specified sums related only to a particular PO#
# 3 Re: Calculated fields in Access
In the grid, show the totals row. Put the PO number in the far left column and click 'Show'. Then, in the next column, put the calculated field. Like:
TotalforThisPO: SUM([Table].[POValue]) and show this field. Any other criteria needs to be in subsequent columns (to the right).
This code is kinda lengthy, but it calculates the total of the project changes that are approved for specific projects. I get two columns - one for the project and one for the total project changes.
SELECT [dbo_tProject].[sProjectCode], Sum([dbo_tDocumentAllocation].[Nvalue1]*[dbo_tDocumentAllocation].[nRoE]) AS TotalValue
FROM (dbo_tProject INNER JOIN ((dbo_tDocumentAllocation INNER JOIN dbo_tBudgetItem ON [dbo_tDocumentAllocation].[iBudgetItem]=[dbo_tBudgetItem].[idBudgetItem]) INNER JOIN (dbo_tDocument INNER JOIN dbo_tDocumentType ON [dbo_tDocument].[iDocumentType]=[dbo_tDocumentType].[idDocumentType]) ON [dbo_tDocumentAllocation].[iDocument]=[dbo_tDocument].[idDocument]) ON [dbo_tProject].[idProject]=[dbo_tBudgetItem].[iProject]) INNER JOIN dbo_tDocumentStatus ON [dbo_tDocument].[iDocumentStatus]=[dbo_tDocumentStatus].[idDocumentStatus]
GROUP BY [dbo_tProject].[sProjectCode], [dbo_tDocumentStatus].[sDesc], [dbo_tDocumentType].[sDesc]
HAVING (((dbo_tProject.sProjectCode) Like "*0534*") AND ((dbo_tDocumentStatus.sDesc)="Approved Change") AND ((dbo_tDocumentType.sDesc)="Project Change"))
ORDER BY [dbo_tProject].[sProjectCode];
Hope this helps.
Laurel
Laurel at 2007-11-11 23:45:22 >
