Full Version: Calculating Date Difference
UtterAccess Discussion Forums > Microsoft® Access > Access Queries
mush182
I am trying to determine the difference between the days on hire and off hire..

so if its between the 10/11 and the 15/11 it is showing up as 5 days... when it should be 6 days... basically i need to add +1 ... but im not sure where to put it... as this qury was set up before i even used it...

Please..

Date Diff: DateDiff("d",[Date],[Off Hire Date])

Hired Days Of The Current Month: mDays([Date],DateDiff("d",[Date],Nz([Off Hire Date],Date()+1)),Forms!frmCurrentMonth!txtCurMonth)

the 2nd one calculates the days on hire in the month selected by the user..

SO i need to add 1 to the days...

any ideas??

Thanks
theDBguy
Just a wild guess, but if you want to add a day to the result of each calculation, then you can try this:

Date Diff: DateDiff("d",[Date],[Off Hire Date]) + 1

Hired Days Of The Current Month: mDays([Date],DateDiff("d",[Date],Nz([Off Hire Date],Date()+1)),Forms!frmCurrentMonth!txtCurMonth) + 1

HTH
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.