Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

count days between two dates

Status
Not open for further replies.

shelspa

Technical User
Dec 13, 2001
66
US
I have a parameter query that shows one record. It has fields for a beginning date and an ending date. I want to count the number of days between the two. Help appreciated.
 
Because of the way dates are stored in Access, you can just subtract the earlier date from the later date to get the exact number of days. Each day equals 1 and partial days are percents. For instance 6:00 am adds .25 (1/4 of day).

I prefer to use the built-in date functions. In this case, try:
DateDiff("d",[BeginningDate], [EndingDate])

Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top