Subtracting query total field from table field?

P

ptlm65

I have a query that has a sum total of the entire colomn in a field. Ho
do I create a query that subtracts that sum total from a field in
different table?

What I am working with is:

tblStudents
HoursGiven

tblHours
DateWorked
HoursWorked

Query1 totals the HoursWorked in the tblHours table but I don't kno
how to subtract that total from HoursGiven in tblStudents. Can anyon
help? Thank you
 
J

John Vinson

I have a query that has a sum total of the entire colomn in a field. How
do I create a query that subtracts that sum total from a field in a
different table?

What I am working with is:

tblStudents
HoursGiven

tblHours
DateWorked
HoursWorked

Query1 totals the HoursWorked in the tblHours table but I don't know
how to subtract that total from HoursGiven in tblStudents. Can anyone
help? Thank you.

Create a Query joining the two tables (by a StudentID field which I
presume must also exist). Make it a Totals query by clicking the Greek
Sigma icon; Group By the tblStudents fields.

In a vacant Field cell type

HoursLeft: [tblStudents].[HoursWorked] - Sum([tblHours].[HoursWorked])


John W. Vinson[MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top