UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Calculating Date Difference    
 
   
mush182
post Dec 7 2007, 10:23 AM
Post #1

UtterAccess Addict
Posts: 161
From: Lancashire, Preston



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
Go to the top of the page
 
+
theDBguy
post Dec 7 2007, 12:30 PM
Post #2

Access Wiki and Forums Moderator
Posts: 47,918
From: SoCal, USA



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
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 19th May 2013 - 01:35 PM