Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Distinct Count Date Specific
Rene Robichaud 
      
3 years ago
Distinct Count (Date Specific)

I have a Member Form and a ServiceRecord Form.

Everytime a member comes in for a service it gets stored in the ServiceRecord form, as one visit, with the member name stored in for that visit and a specific service date.

With this information and using a query, I can run statistics on a report to show how many visits we had in a select time period. For example, if I want to know how many services we have rendered between Aug2023 and Sept2023, I have a calculated textbox set up on my report.

To simplify, lets pretend there was only 4 visits between this date range (between Aug 2023 and Sept 2023).

The Problem: If it was a new member each time that would be easy, just count the number of records you get the number of members that visited, however one member can visit more than once. Don't want to count this member twice.

In other words: if this month, we had rendered 4 services (=4 visits), but one member came in twice we basically only served 3 unique members during that month. I want to be able to see on my report's count field A >> ServicesRendered=4 and field B >> MembersServed=3 for this month.

Note:(Unique Values set to Yes in the query property sheet or Distinct in the query SQL statement does not work because the visit dates are different and required). I still want to be able to see how many unique members got served, but within a date range.

How would I go about setting this up?

Any help appreciated!
Rene Robichaud OP  @Reply  
      
3 years ago

Rene Robichaud OP  @Reply  
      
3 years ago

Kevin Robertson  @Reply  
           
3 years ago
Build a query that gives you the number of members served between your two dates.
Then in the Control Source of the Text Box on your report you can lookup that specific number with a DLookup.
Rene Robichaud OP  @Reply  
      
3 years ago
I'm not certain how to set-up a query to show only unique members served between the two dates. I can show all unique members if I remove the ServiceDate field, but I do need the service date field to filter my report. In the example above, my name comes up twice on the list, but it has to because there are assigned to two different date values.

Is there a specific formula I can use for the DLookup to show all unique values only?
Rene Robichaud OP  @Reply  
      
3 years ago

Rene Robichaud OP  @Reply  
      
3 years ago

Kevin Robertson  @Reply  
           
3 years ago
OK. I've put together a sample for you (see screenshots).

The first image is my setup.
The second image is my Report.

Let me know if this works for you and if it's what you are looking for.
Kevin Robertson  @Reply  
           
3 years ago

Kevin Robertson  @Reply  
           
3 years ago

Kevin Robertson  @Reply  
           
3 years ago
Sorry, I forgot to mention the Control Source for the Text Boxes on the Report.
I used the DCount function for both.

=DCount("*","ServiceQ")
and
=DCount("*","UniqueMemberCountQ")
Rene Robichaud OP  @Reply  
      
3 years ago
Aw man. You're Great! Another one in the tip jar for you! :-D

What I was doing wrong is I wasn't using an aggregate query (total) to "group by" and place a "where" condition for the date.

Thanks for the help mate!
Kevin Robertson  @Reply  
           
3 years ago
You're welcome.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 6/27/2026 12:00:55 AM. PLT: 1s