Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Help   Contact   Merch   Join   Order   Logon   Forums   
 
Back to Access Forum    Comments List
Upload Images | @Reply | Bookmark | Link | Email | Next Unseen |
Visits by specified dates
Colin Smyth 
      
2 years ago
I have a table which lists PersonalID and DateSeen. I can use a design wizard Query which allows me to see how many people were seen each quarter. Another query allows me to see how many each month. But when I add specified dates using between and adding a first and last date, it works but it just shows me how many were seen on each day and I can't find a way to add up the number of people seen in those specified dates. I will attach the queries and results. Can someone help how I can get a total seen for spcified days.
Colin Smyth OP  @Reply  
      
2 years ago

Colin Smyth OP  @Reply  
      
2 years ago

Colin Smyth OP  @Reply  
      
2 years ago

Kevin Robertson  @Reply  
          
2 years ago
Try doing it like this (see screenshot).
Does that give you what you need?
Kevin Robertson  @Reply  
          
2 years ago

Kevin Robertson  @Reply  
          
2 years ago
For your information: I used the Absolute Value (Abs) because the expression returns a negative number. This makes it positive.
Kevin Yip  @Reply  
     
2 years ago
You need to change GROUP BY to WHERE, if you only want that column to be a criterion and not part of a group.
Colin Smyth OP  @Reply  
      
2 years ago
Thank you Kevin R and Kevin Y - this now works fine. Can I ask one other question. If I set up a report with the information received by the query, is there a way that I can automatically show in the header that it shows the start and end dates. I will attach a screen shot of what I mean. Thank you
Colin Smyth OP  @Reply  
      
2 years ago

Kevin Robertson  @Reply  
          
2 years ago
Instead of parameters consider getting your date values from a couple of Form fields. This will make it much easier to plug the values into your Header Label.
Colin Smyth OP  @Reply  
      
2 years ago
Hi Kevin. I understand what you are saying, but not sure how to do it. Do I need to set up a different query without the parameter fields and instead enter those dates on a form, but how do I then get it to do the sums?
Colin Smyth OP  @Reply  
      
2 years ago
Hi Kevin. Realised how you use the Forms!FormName!StartDate etc, but it then doesn't show me a total when I run the query.
The original query that you sent was: Number Seen for Dates: Sum(Abs([DateSeen] Between [Start Date] And [End Date])). When I substitute the Forms! etc. it looks like this: Number Seen: Sum(Abs([DateSeen] Between [Forms]![BridgeleySubMenu2ReportF]![StartDate] And [Forms]![BridgeleySubMenu2ReportF]![EndDate])) Looks right to me but it doesn't give a total. The form where I am entering the data is open. Any suggestions please. I submitted it as a jpg to make it easier to read
Colin Smyth OP  @Reply  
      
2 years ago

Kevin Robertson  @Reply  
          
2 years ago
Let me know if the screenshot below helps.
Kevin Robertson  @Reply  
          
2 years ago

Colin Smyth OP  @Reply  
      
2 years ago
Hi Kevin. Thank you so much for your time and effort for me. The result is what I want. Can you clarify a couple of things for me
1. Do I create a blank form called AssistanceGivenF?
2. The actual count is based on the PersonID. Each person may have multiple assistances give (AssistanceID). What we need to know is how many different people (personID) are seen in that specified time - so in the last line of your code, should it have PersonID.assistancegivenT so it counts the Person ID.
Thanks again for all your help - look forward to hearing from you
Colin Smyth OP  @Reply  
      
2 years ago
Hi Kevin. Can you tell me if you set up the form AssistanceGivenF with the header and label first. When I try and run the code you sent, I get this error....Object doesn't supportthis property or method and this line is highlighted in the vba code
HeaderCaption = "Number Seen from " & StartDate & " to " & EndDate
Not sure where to from here. Thank you

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

Next Unseen

 
 
What's This?

 

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: 10/11/2026 11:42:53 PM. PLT: 1s