ACCESS 2000 Time Calculation (1 Viewer)

Djhilbert

Registered User.
Local time
Today, 11:30
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:
 

John Big Booty

AWF VIP
Local time
Tomorrow, 04:30
Joined
Aug 29, 2005
Messages
8,263
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
 

vbaInet

AWF VIP
Local time
Today, 19:30
Joined
Jan 22, 2010
Messages
26,374
By the way, why don't you have a Date part? How can you be sure that it's actually +1 day or more?
 

Djhilbert

Registered User.
Local time
Today, 11:30
Joined
Dec 26, 2011
Messages
17
There is a date on the call log but the incident report only has times they are joined by the incident numbers
 

vbaInet

AWF VIP
Local time
Today, 19:30
Joined
Jan 22, 2010
Messages
26,374
As long as your date isn't a difference of more than one day you will be fine.
 

Users who are viewing this thread

Top Bottom