Microsoft Access 2013 Report Grouping levels need to count unique records

I have a report almost complete. I track request from various sources. The database tracks the time spent on each request. dbreqid is the key field and the request has multiple entries for documenting time. When I do a group by requester and count the number of request it counts for each of my time records. One request will have multiple time records. How do I count just the distinct records in the dbreqid field. I have group level for the source but it counts each individual time record not each dbreqid. I tried to group on dbreqid but that doesn't work either. Thanks for the help.
marlind605Asked:
Who is Participating?
 
Gustav BrockConnect With a Mentor CIOCommented:
You'll have to use a subquery, something like this:

Select
    T.Source,
    T.Requester,
    T.TotalTime,
    Count(*) As Requests
From
    (Select Source, Requester, Sum(TimeSpent) As TotalTime From tblTable Group By Source, Requester) As T
Group By
    T.Source,
    T.Requester,
    T.TotalTime

This should give you the clean figures.
In your report, however, you would do the grouping and counting, Thus it should use the subquery above as source.

/gustav
0
 
PatHartmanCommented:
You may need to break the report into a main report with a subreport.  That will allow you to count records separately for each recordset.
0
 
marlind605Author Commented:
I am looking at the two answers. Thanks.
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
marlind605Author Commented:
Still not getting this. Tried subreports and different queries. Any other help?
0
 
Gustav BrockCIOCommented:
That's hard without knowing what you did try.

/gustav
0
 
marlind605Author Commented:
What I ended up doing was creating two make table queries one to show each request by organization and the other created from the first result to show count by organization and request and then used the added the query to the one I was using for the report. It is not the way I wanted to go but seems to run quick and is accurate. There may be another solution but I couldn't figure it out. Thanks for all the replies.
0
 
Gustav BrockCIOCommented:
OK, thanks for the feedback.

/gustav
0
All Courses

From novice to tech pro — start learning today.