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 
Date of Highest Blood Pressure
Alan Higgins 
     
15 months ago
I have a 2 table blood pressure DB. i would like to create a query that will give me the highest Diastolic and Systolic pressure number and the associated dates for those numbers. Each criteria is in separate fields in the BP table. Any help would be greatly appreciated. Thanks
Sami Shamma  @Reply  
             
15 months ago
Please be more specific. See Rule #2.
Please send screenshots of the tables involved in Design View.
Alex Hedley  @Reply  
           
15 months ago
Alex Hedley  @Reply  
           
15 months ago
Richard Rost  @Reply  
          
15 months ago
Probably something like:

Sys = DMax("Systolic","BloodPressureT")

Then you can look up the date with DLookup:

D = DLookup("MyDate","BloodPressureT","Systolic=" & Sys)

I've got a similar TechHelp video coming out soon. Another student asked how to find the date of their highest sale amount. Same principle.
Alan Higgins OP  @Reply  
     
15 months ago
Thank you all, i greatly appreciate your help
Alan Higgins OP  @Reply  
     
15 months ago
Thanks for the DMax code it works perfectly on the entire database however i need to use a query with between dates to obtain the highest pressure in a date range. When i change the table name in the string to the query name, i get errors. Any suggestions would be appreciated. Thanks

Sys: DMax("Diastolic","BPQ")
D: DLookUp("PatDate","BPQ","Diastolic=" & [Sys])
Alex Hedley  @Reply  
           
15 months ago
What's the error?
Richard Rost  @Reply  
          
15 months ago
Do you have parameters in that query? Try to D-Function directly from a table if possible. It will run faster too.
Alan Higgins OP  @Reply  
     
15 months ago
Attached is the query and the results. I am trying to result the highest BP and Date it was taking for the period in the date criteria. The results are incorrect even if i specify the date range i am still getting the results from the entire table. If reconfigure the query using a query in place of the table, i get syntax errors.
Alan Higgins OP  @Reply  
     
15 months ago

Alan Higgins OP  @Reply  
     
15 months ago

Kevin Robertson  @Reply  
          
15 months ago
Put the value you want the maximum o in the first column and use DMax for your criteria. Then you can use DLookup in the second column to look up the date. See screenshot below.

Note: this is something I would usually do with a couple of Form fields. Then you wouldn't need the query at all.
Kevin Robertson  @Reply  
          
15 months ago

Alan Higgins OP  @Reply  
     
15 months ago
I tried to do that on the form in a text field and have done that before but i just couldn't get it configured.
Kevin Robertson  @Reply  
          
15 months ago

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: 8/7/2026 10:07:45 PM. PLT: 1s