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

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Calculate Hours between two dates    
 
   
jmorrow76
post Mar 9 2005, 04:11 PM
Post #1

New Member
Posts: 16



I am working on a punch in punch out feature for a projects db I am working on & I can not figure out how to calculate the hours between the check out date & check in dates. Any ideas or snippets?
Go to the top of the page
 
+
R. Hicks
post Mar 9 2005, 04:26 PM
Post #2

UA Forum Administrator
Posts: 38,073
From: Birmingham, Alabama USA



Use the DateDiff() function to return the elasped time ...

RDH
Go to the top of the page
 
+
AJS
post Mar 9 2005, 04:26 PM
Post #3

UtterAccess VIP
Posts: 3,893
From: Lansing, Michigan, USA



Try the DateDiff function, assuming your check in and check out dates are actual date/time values.

DateDiff("h", CheckIn, CheckOut)

-AJ
Go to the top of the page
 
+
jmorrow76
post Mar 9 2005, 04:49 PM
Post #4

New Member
Posts: 16



That works perfect! One more quickie, how do I get it to be a positive num instead of a negetive?
Go to the top of the page
 
+
R. Hicks
post Mar 9 2005, 05:23 PM
Post #5

UA Forum Administrator
Posts: 38,073
From: Birmingham, Alabama USA



You need to reverse your date values in the function arguments ...

The start date/time is should be first .. then the end date/time ..

RDH
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: 21st May 2013 - 10:33 PM