Avatar of Karl001
Karl001Flag for Canada

asked on 

Access query - number of days between 2 datese

Hi,

I would like to know, in a query, how can I calculate the numbers of days between 2 dates

Thanks
Microsoft Access

Avatar of undefined
Last Comment
crystal (strive4peace) - Microsoft MVP, Access
ASKER CERTIFIED SOLUTION
Avatar of Dale Fye
Dale Fye
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of crystal (strive4peace) - Microsoft MVP, Access
crystal (strive4peace) - Microsoft MVP, Access

adding on: if date also contains a time component, you can test this and subtract one day if time for comparison date is greater than time for the first date since a full day(s) will not have passed.
Depends on what you need to know.  For example, as Dale noted, you could use DateDiff, but what that delivers is the number of time period boundaries between two date/time values.

For example, consider these two values:

2016-09-05 23:59:59
2016-09-07 00:00:00

DateDiff using "d" for the interval length, would return two.  In terms of true time elapsed, it's one day plus one second.

So, what specifically are you trying to calculate?
hi Patrick! ... hence my comment too ;)
Microsoft Access
Microsoft Access

Microsoft Access is a rapid application development (RAD) relational database tool. Access can be used for both desktop and web-based applications, and uses VBA (Visual Basic for Applications) as its coding language.

226K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo