Date difference

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to use the DateDiff expression, but want the result to display 2
decimal places?
 
DateDiff returns a Long Integer, so displaying decimal places doesn't make
sense.
 
What kind of date math?

DateDiff returns the number of "crossings" between two dates: the number of
days represents how many times the date crosses midnight, the number of
weeks represents how many times the date crosses a Sunday, the number of
years represents how many times the date crosses Dec. 31 and so on. You
cannot combine units, therefore, as I said earlier, there are no decimal
places to display.
 
for example: start date: 2/18/1987 end date: 3/7/2007 display result of
20.05

Is there a way to get Excel to do this calculation? I know that Excel can
do this type of calculation.
 
Try using

DateDiff("d", [StartDate], [EndDate]) / 365.25

and either format the result, or use the Round function.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top