View Full Version : Subtotal Query.


Jiraiya-Sama
06-12-2009, 10:19 AM
Hello Hi,

I have a question about calculating subtotal and rate.

I have 2 tables - TimeLog and Rate

TimeLog
- StaffID
- WorkingHrs

Example

StaffID WorkingHrs
A123 5
B234 3
C345 6
A123 4
C345 2



Rate
- StaffID
- Rate

Example

StaffID Rate
A123 2.5
B234 4.5
C345 3.2


Now i want to create a query to calculate total working hours for each staff and then multiply the rate.
So, I want to create something like this...


StaffID TotalHrs Rate Salary
A123 9 2.5 22.5
B234 3 4.5 13.5
C345 8 3.2 25.6


Any suggestions how to create this query would be appreciated :)
Thanks very much.

chefdaveross
06-12-2009, 06:02 PM
Easy way to do it is to make you query
add your fields, and make an expression using the build feature.
should look like this after
Expr1:[TotalHours]* [Rate] *[Salary]