Duration

xeb

Registered User.
Local time
Today, 15:39
Joined
Apr 14, 2004
Messages
46
I'm using this...Hour([SumElapsedTime])>9...in CF and it has been working fine. It changes the text to red. However, today one student's duration reached 24:11 and it is no longer changing the text to red. I suspect it has something to do with it going over 24 hours (which it did today) but I have no idea how to fix it. Thanks.
 
What field type is SumElapsedTime or the field type of the underlying field? My initial guess would be to edit your criteria to see if it is longer than a day.
 
It's a text box. I don't understand what you mean by...edit your criteria to see if it is longer than a day.
 
You can't use HOUR because the "hours" only go to 24. There are only 24 hours in the day. You would need to strip it of the hour:

CInt(Left(Cstr([SumElapsedTime]),Instr(1,Cstr([SumElapsedTime]),":")-1)
 
How are you getting [SumElapsedTime] ?

If the input fields are in Date/Time format why not use
Code:
DateDiff("h",[SatrtDateTime],[EndDateTime])
 
Thanks for the help.

This works...

CInt(Left(CStr([SumElapsedTime]),InStr(1,CStr([SumElapsedTime]),":")-1))>9

Thanks Bob Larson!
 

Users who are viewing this thread

Back
Top Bottom