• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 607
  • Last Modified:

Want to total all grouped hours into total sum of hours in an access report

Hello,

I need assistance again please.  

I received assistance with obtaining total hours based on another field being grouped.  I have tried to sum up all of the total hours listed, but am not able to successfully sum up all of the total hours collected.

This worked in the query and shows well in the report:

TotalHours: FormatHourMinute(Sum([YourDateField]))

I have tried to use the sum formula and making sure the the format of the field in the report footer would have the format of short time but using sum and the field give me either the first value in the list, or #Error in the field, or Data type mismatch in criteria expression.

The latest tried was:

=Sum([TotalHours])

The other fields used were easy to total in the Report footer.  The total hours field just allows for Count Records and Count Values.

Thank you so much.
0
mtrout
Asked:
mtrout
  • 3
  • 2
1 Solution
 
hnasrCommented:
If you have a field name in report's record source, f1
In Field group add text field with control source = SUM(f1)

For grand total, use the same t field name in report's record source, f1
In report footer add a text box with record source = SUM(f1)

In your code:
 Total in report footer:
=Sum([TotalHours])      ====>  Sum([YourDateField])
0
 
mtroutAuthor Commented:
Hello,
That's what I put in the Report footer

=Sum([TotalHours])

and I get the error
 
'Data type mismatch in criteria expresson'

Maybe I have it in the wrong place or something?

Unfortunately, I will not be able to respond until the 25th.  I hope it's ok to resume this later.  I have enclosed what I am doing.

I did not want to 'look bad' by not responding; and without a reason why.  Will converse again soon.  Thank you so much.
Meeting-File.accdb
Screen-Shots-for-Grand-Totals.doc
0
 
hnasrCommented:
The problem is with last control, it sums date format.

Try this version:
Meeting-File-2.accdb
0
 
mtroutAuthor Commented:
When the query was modified by Hnasr to include the correct total hours of the sum and the format was added to the report, this worked.  Thank you Hnasr!
0
 
hnasrCommented:
Welcome!
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now