?
Solved

Total of different days between 2 dates

Posted on 2011-09-16
3
Medium Priority
?
402 Views
Last Modified: 2012-08-13
How I can calculate Total of different days between 2 dates ?

Vba
0
Comment
Question by:egovernment
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 18

Expert Comment

by:Cluskitt
ID: 36548261
What do you mean by different days?
0
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 2000 total points
ID: 36548281
Days = DateDiff("d", Date1, Date2)
0
 
LVL 93

Expert Comment

by:Patrick Matthews
ID: 36549965
Do you need to take time of day into account?  For example:

Date1: 2011-09-15 20:37
Date2: 2011-09-16 04:15

In that scenario, DateDiff("d", Date1, Date2) returns 1, even though a full 24 hours have not elapsed.  That may or may not be what you need.

Patrick
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Make the most of your online learning experience.
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question