Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   Index   Templates   Seminars   TechHelp   Forums   Help   Contact   Join   Order   Logon  
 
Home > TechHelp > Directory > Access > DateDiff Previous Record < Subquery | Records & Fields >
DateDiff Previous Record
By Richard Rost   Richard Rost on LinkedIn Email Richard Rost   4 days ago

Calculate Date Differences Between Records in Access


 S  M  L  XL  FS  |  Slo  Reg  Fast  2x  |  Bookmark Join Now

In this Microsoft Access tutorial, I will show you how to calculate the difference in dates between a record and the previous record. We'll start by using the easy method with the DMax function for quick calculations, though it may be slower for larger datasets. You'll learn how to create a query to determine the time difference between consecutive orders for a customer. We'll address common issues such as handling duplicate contact dates, setting up your query without errors, and why the DMax method is best suited for smaller datasets.

Zoe from Springfield, Missouri (a Platinum Member) asks: How can I figure out the time between two consecutive orders for a customer in Microsoft Access? I've got this list of orders and dates but I'm not sure how to calculate the days between them like I do in Excel. For instance, if the first order was on March 1st and the next one was on March 3rd, I'd want it to show there's a 2 day difference. I'm also curious about what happens if two orders are on the same date. Any ideas on how to get started with this in Access?

Members

In the extended cut, we will learn how to calculate the date differences using two subqueries instead of the DMax method. I will show you how to select the previous contact date using subqueries for a more efficient calculation, which is especially useful for large datasets. Additionally, we will address the issue of handling records with identical dates by ensuring the date difference shows zero without including the current record itself. This approach involves writing a more complex query that accurately handles duplicate contact dates and performs the calculations efficiently.

Silver Members and up get access to view Extended Cut videos, when available. Gold Members can download the files from class plus get access to the Code Vault. If you're not a member, Join Today!

Prerequisites

Links

Recommended Courses

Learn More

FREE Access Beginner Level 1
FREE Access Quick Start in 30 Minutes
Access Level 2 for just $1

Free Templates

TechHelp Free Templates
Blank Template
Contact Management
Order Entry & Invoicing
More Access Templates

Resources

Diamond Sponsors - Information on our Sponsors
Mailing List - Get emails when new videos released
Consulting - Need help with your database
Tip Jar - Your tips are graciously accepted

Questions?

Please feel free to post your questions or comments below or post them in the Forums.

KeywordsDateDiff Previous Record in Microsoft Access

TechHelp Access, date differences, consecutive records, DMax function, time between orders, calculated fields, Nz function, CDate function, subquery usage, ContactDate, PreviousContactDate, domain aggregate functions, subquery optimization, identical date issues, expert-level Access tips

 

 

 

Comments for DateDiff Previous Record
 
Age Subject From
12 daysTranscriptRichard Rost
12 daysQuizRichard Rost
11 daysSql ServerSami Shamma
11 daysNotes to Access TeamSami Shamma

 

Start a NEW Conversation
 
Only students may post on this page. Click here for more information on how you can set up an account. If you are a student, please Log On first. Non-students may only post in the Visitor Forum.
 
Subscribe
Subscribe to DateDiff Previous Record
Get notifications when this page is updated
 
 
 
 

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 2025 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 2/15/2025 2:45:30 PM. PLT: 1s
Keywords: TechHelp Access, date differences, consecutive records, DMax function, time between orders, calculated fields, Nz function, CDate function, subquery usage, ContactDate, PreviousContactDate, domain aggregate functions, subquery optimization, identical date  PermaLink  DateDiff Previous Record in Microsoft Access