Calculate days elapsed in Access?

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

Guest

Hello,

Is there a way in access to have it automatically calculate how many days
have passed between a start date and an end date? And if there is no end date
yet, how many day have gone by between the start date and today?
 
Yes, the DateDiff function will do what you want. Details are in the help
file.
 
Hi Niniel

Between 2 dates

=DateDiff("d", [Date1], [Date2])

Between a Date and today

=DateDiff("d", [OrderDate], Date())

Hope this helps
 
=iif(isnull([end date]),DateDiff("d",[Start Date],
Date()),DateDiff("d",[Start Date],[End Date]))
 
Or, perhaps simpler,

DateDiff("d",[Start Date], Nz([End Date], Date()))


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


schasteen said:
=iif(isnull([end date]),DateDiff("d",[Start Date],
Date()),DateDiff("d",[Start Date],[End Date]))


Niniel said:
Hello,

Is there a way in access to have it automatically calculate how many days
have passed between a start date and an end date? And if there is no end
date
yet, how many day have gone by between the start date and today?
 
Wow, that's a lot of useful information there, thanks a lot!
Now I just have to figure out where this goes. :)
 

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