Subtotal Query.

Jiraiya-Sama

New member
Local time
Today, 06:42
Joined
Jun 12, 2009
Messages
2
Hello Hi,

I have a question about calculating subtotal and rate.

I have 2 tables - TimeLog and Rate

TimeLog
- StaffID
- WorkingHrs

Example
Code:
[U]StaffID   WorkingHrs[/U]
A123      5
B234      3
C345      6
A123      4
C345      2

Rate
- StaffID
- Rate

Example
Code:
[U]StaffID    Rate[/U]
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...

Code:
[U]StaffID    TotalHrs    Rate    Salary[/U]
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.
 
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]
 

Users who are viewing this thread

Back
Top Bottom