ACCESS 2000 Time Calculation

Djhilbert

Registered User.
Local time
Yesterday, 23:13
Joined
Dec 26, 2011
Messages
17
I'm having a problem getting the correct minutes when the time out goes to the next day. example: if the time in is 23:40 and the time out is 02:20 I get -1280. What can I do to correct this problem.:confused:
 
You could use the following code to test and account for time periods that fall across midnight;
Code:
    If Me.EndTime < Me.StartTime Then
        Me.YourTextBox = [URL="http://www.techonthenet.com/access/functions/date/datediff.php"]DateDiff[/URL]("n", Me.StartTime, "23:59") + 1 + DateDiff("n", "00:00", Me.EndTime)
    Else
        Me.YourTextBox = DateDiff("n", Me.StartTime, Me.EndTime)
    End If
 
By the way, why don't you have a Date part? How can you be sure that it's actually +1 day or more?
 
There is a date on the call log but the incident report only has times they are joined by the incident numbers
 
As long as your date isn't a difference of more than one day you will be fine.
 

Users who are viewing this thread

Back
Top Bottom