Question on Creating a total calulation in a Query

D

Dirk_Bob

I have a field in a query that hold the number of hours an individual has
worked.
I created a query entry to sum the field. When I place it on my report, it
always = the last name shown in the report. It does not sum all the entrys.
Any ideas apprecaited.

Thanks,
 
J

John Vinson

I have a field in a query that hold the number of hours an individual has
worked.
I created a query entry to sum the field. When I place it on my report, it
always = the last name shown in the report. It does not sum all the entrys.
Any ideas apprecaited.

Thanks,

Please indicate the name of the field, the SQL of the query, and what
you place on the report. You can see your database; we can't!

I'm GUESSING that you're trying to have both the value and the sum of
the values in every record in the query. Don't. Instead, just have a
field in the Query with the individual hours; use the Report's Sorting
and Grouping feature to group over the field (individual? group of
individuals? all?) and put a textbox in the appropriate report Footer
with a control source

=Sum([hoursfield])

John W. Vinson[MVP]
 
D

Dirk_Bob

Thanks,

It is a standard query with a field called "billable hours". It is set to
"Group by"
In the report, I added a text box in the footer section =sum([billable hours])
When I run the report I get an #error in the text box.


John Vinson said:
I have a field in a query that hold the number of hours an individual has
worked.
I created a query entry to sum the field. When I place it on my report, it
always = the last name shown in the report. It does not sum all the entrys.
Any ideas apprecaited.

Thanks,

Please indicate the name of the field, the SQL of the query, and what
you place on the report. You can see your database; we can't!

I'm GUESSING that you're trying to have both the value and the sum of
the values in every record in the query. Don't. Instead, just have a
field in the Query with the individual hours; use the Report's Sorting
and Grouping feature to group over the field (individual? group of
individuals? all?) and put a textbox in the appropriate report Footer
with a control source

=Sum([hoursfield])

John W. Vinson[MVP]
 
J

John Vinson

Thanks,

It is a standard query with a field called "billable hours". It is set to
"Group by"
In the report, I added a text box in the footer section =sum([billable hours])
When I run the report I get an #error in the text box.

Ummm... why are you *GROUPING* by billable hours? That will give a
separate record for each value of this field.

Try basing your Report on a non-totals query and using the Report's
Sorting and Grouping dialog to group on appropriate fields; you can do
the summing in the footer of the report, or of each group.

John W. Vinson[MVP]
 
D

Dirk_Bob

Thanks John,

That cleared things up. I now understand the grouping somewhat better.

John Vinson said:
Thanks,

It is a standard query with a field called "billable hours". It is set to
"Group by"
In the report, I added a text box in the footer section =sum([billable hours])
When I run the report I get an #error in the text box.

Ummm... why are you *GROUPING* by billable hours? That will give a
separate record for each value of this field.

Try basing your Report on a non-totals query and using the Report's
Sorting and Grouping dialog to group on appropriate fields; you can do
the summing in the footer of the report, or of each group.

John W. Vinson[MVP]
 
Top