Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calculating Weighted Average using Queries

Status
Not open for further replies.

112nokia

Technical User
Nov 21, 2006
12
YU
Hi,
How can you calculate the weighted average using a query. The weighted average should be calculated from table Dataentry, Field name "Amount", weighted by the FIrate in the same table, and than sum("amount"). --- in MS excel the formula is roughly Sumproduct( column A,Column B)/ sum(column A). Hipotetically, Column A= Amount, Column B= FIrate.

Ofoucrse I must perform this in MS Access.

Additional selection from table should be last 5 records, Using the "Dop" named column in the same table .

Help needed, please??!
 
How about:
[tt]SELECT Sum([Field1]*[Field2]) AS Product, Sum(Field1) AS Total, [Product]/[Total] AS Average
FROM tblTable;[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top