Solved

Total of different days between 2 dates

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

Vba
0
Comment
Question by:egovernment
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 500 total points
ID: 36548281
Days = DateDiff("d", Date1, Date2)
0
 
LVL 92

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

895 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now