I have a table that consists of Customer ID’s and trip start and end dates. I need to find any trips where the start date of a trip is within one day of the previous trips end date. For example, customers trip ends on 01/01/10 and the next trip started on 01/02/10. Does anyone have any suggestions on how I might do that?
![]() |
There are isolated problems with current patches, but they are well-known and documented on this site. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
Comparing and calculating trip-date differences
Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Comparing and calculating trip-date differences
- This topic has 2 replies, 3 voices, and was last updated 14 years, 8 months ago.
AuthorTopicWSTAnderson
AskWoody LoungerSeptember 16, 2010 at 7:42 pm #471735Viewing 1 reply threadAuthorReplies-
WSkentg
AskWoody LoungerSeptember 17, 2010 at 1:44 am #1244910First you need to understand that dates are just numbers. In fact they are more or less double, so the time now is 40438.6782638889
Anything to the left of the decimal point is the day, the decimal part is the time.
So if you store just the date, today is 40438.0
To calculate differences you must ensure that you are not being messed around by the time.
Now down to business – This is the kind of thing where Excel is actually better than access. In Excel you can use a formula that compare the value in a cell with the value in a cell in the previous row.
To do the same thing in Access I would use a report with some code in the detail’s format event to set a module level variable and then for each record compare the start date to the variable from the last record then set the variable again.
You can see a simple example in the attached database.
-
WSpatt
AskWoody LoungerSeptember 17, 2010 at 7:58 pm #1245396I have a table that consists of Customer ID’s and trip start and end dates. I need to find any trips where the start date of a trip is within one day of the previous trips end date. For example, customers trip ends on 01/01/10 and the next trip started on 01/02/10. Does anyone have any suggestions on how I might do that?
Do you need to do this via queries? If so, check out the attached.
I have assumed that it can be across all customers, not just the same customer. I have included another query for the same customer if that is required.
Viewing 1 reply thread -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
What is wrong with simple approach? (Awaiting moderation)
by
WSSpoke36
1 hour, 4 minutes ago -
Frustrating search behavior with Outlook
by
MrJimPhelps
4 hours, 25 minutes ago -
June 2025 Office non-Security Updates
by
PKCano
7 hours, 38 minutes ago -
Secure Boot Update Fails after KB5058405 Installed
by
SteveIT
19 minutes ago -
Firefox Red Panda Fun Stuff
by
Lars220
7 hours, 35 minutes ago -
How start headers and page numbers on page 3?
by
Davidhs
17 hours, 59 minutes ago -
Attack on LexisNexis Risk Solutions exposes data on 300k +
by
Nibbled To Death By Ducks
12 hours, 34 minutes ago -
Windows 11 Insider Preview build 26200.5622 released to DEV
by
joep517
1 day, 2 hours ago -
Windows 11 Insider Preview build 26120.4230 (24H2) released to BETA
by
joep517
1 day, 2 hours ago -
MS Excel 2019 Now Prompts to Back Up With OneDrive
by
lmacri
16 hours, 22 minutes ago -
Firefox 139
by
Charlie
8 hours, 58 minutes ago -
Who knows what?
by
Will Fastie
3 hours, 30 minutes ago -
My top ten underappreciated features in Office
by
Peter Deegan
1 day, 3 hours ago -
WAU Manager — It’s your computer, you are in charge!
by
Deanna McElveen
21 hours, 48 minutes ago -
Misbehaving devices
by
Susan Bradley
2 hours, 32 minutes ago -
.NET 8.0 Desktop Runtime (v8.0.16) – Windows x86 Installer
by
WSmeyerbos
2 days, 9 hours ago -
Neowin poll : What do you plan to do on Windows 10 EOS
by
Alex5723
6 hours, 42 minutes ago -
May 31, 2025—KB5062170 (OS Builds 22621.5415 and 22631.5415 Out-of-band
by
Alex5723
2 days, 7 hours ago -
Discover the Best AI Tools for Everything
by
Alex5723
1 day, 7 hours ago -
Edge Seems To Be Gaining Weight
by
bbearren
1 day, 22 hours ago -
Rufus is available from the MSFT Store
by
PL1
2 days, 6 hours ago -
Microsoft : Ending USB-C® Port Confusion
by
Alex5723
3 days, 9 hours ago -
KB5061768 update for Intel vPro processor
by
drmark
1 day, 8 hours ago -
Outlook 365 classic has exhausted all shared resources
by
drmark
1 day, 7 hours ago -
My Simple Word 2010 Macro Is Not Working
by
mbennett555
3 days, 4 hours ago -
Office gets current release
by
Susan Bradley
3 days, 7 hours ago -
FBI: Still Using One of These Old Routers? It’s Vulnerable to Hackers
by
Alex5723
4 days, 21 hours ago -
Windows AI Local Only no NPU required!
by
RetiredGeek
4 days, 6 hours ago -
Stop the OneDrive defaults
by
CWBillow
4 days, 22 hours ago -
Windows 11 Insider Preview build 27868 released to Canary
by
joep517
5 days, 8 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.