Total Days Between Two Dates.

mshelley1

Carbo
Local time
Today, 12:24
Joined
Feb 12, 2006
Messages
45
Access 2000




Greetings:

I have a form that has three textboxes and a button. The first textbox named “Date” contains a previous date, the second textbox named ”EndDate” will contain the current date. The third textbox named “TotalDays needs to contain the total number of days between “Date” and “EndDate”. The code should run OnClick of the button named “calculate”

Thanks in advance
 
Try the DateDiff() function

DateDiff ("interval", date1, date2)

In your case:

DateDiff("d", [Date], [EndDate]) should return the number of days between the two dates.

You could also us "w" for weeks, "m" for months or "y" for years.

I think I got the context correct. If it doesn't work do a search on DateDiff()
 
Last edited:

Users who are viewing this thread

Back
Top Bottom