View Full Version : Totalling Calculated Field


databasedonr
01-05-2004, 01:27 PM
I've just inherited a database problem -- aren't I the lucky one?! In a project tracking database, we are tracking time spent by employee on a project. For individual projects, we have a query that totals the time each person has spent on this project, as follows:
***********
SELECT Sum(tblHoursActivity.[Working Hours]) AS [SumOfWorking Hours], tblHoursActivity.Department, Last(tblHoursActivity.Dates) AS LastOfDates, tblProject.[Project Title], tblHoursActivity.LastName
FROM tblProject INNER JOIN tblHoursActivity ON tblProject.ProjectID = tblHoursActivity.[Project ID]
GROUP BY tblHoursActivity.Department, tblProject.[Project Title], tblHoursActivity.LastName
HAVING (((tblProject.[Project Title])=[Forms]![frmHoursProject]![cboSearch]));
***********
This query is then used as the basis of a report. The report creates a total number of hours for each person for the project.

What I would like to do is add, in the report footer, a total of all the hours for all the people -- and I am completely lost.

Appreciate any help coming back -- thanks in advance.

databasedonr

Rich
01-05-2004, 01:32 PM
=Sum([SumOfWorking Hours])

databasedonr
01-05-2004, 01:39 PM
Thanks Rich, but this gives me #error as a result....

Rich
01-05-2004, 01:51 PM
Check the spelling of your field as it appears in the field list of your report

databasedonr
01-06-2004, 06:01 AM
Nope. It's spelled correctly. If it were only that easy.... Still doesn't work, still returns the #Error. I've even changed the field names to remove the space to make sure I am duplicating the name properly.

Rich
01-06-2004, 11:46 AM
Post a 97ver here, put some dummy data in it

databasedonr
01-07-2004, 06:05 AM
Here is the stripped down version of the database - -no names show in the report because I haven't included the table. The times - -and the error - come up.

Use the form to launch the report if you like -- the query will prompt you for form, and "Seniors Take Charge" is the project with the most data.

Thanks for taking a look.

Rich
01-07-2004, 12:02 PM
I wasn't able to import either your form or report, I've included a quickly built report.
There are other problems with the tables though:(

databasedonr
01-07-2004, 12:16 PM
Thanks -- I see it working there -- I was trying to use the existing report, but obviously it works.

Other problems with the tables - - yes! The database is a bit of a mess -- I'm trying to cobble it together to get it working, but am tempted to start over -- I didn't include all the tables in the sample I posted, but there is duplicated keys, text fields used as foreign keys....

Rich, thanks a bunch for your help. I will try and import it, or, I will simply try and redesign.

Thanks again for the time spent....