I'm trying to calculate elapsed time between StartTime and EndTime in seconds.
Both StartTime & EndTime are bound text boxes (datetime data type) in a form.
The table contains another field (RegisteredOn) which has a default value of =Date().
My first attempt was using DateDiff. But the result is not correct in some situations like this:
StartTime : 08:00 PM
EndTime : 01:30 AM
If I include date with the recorded time, DateDiff may work, but it's not desirable for me to type something like 2021/09/10 08:00 PM each time.
If there's a way to let me type only minutes and seconds but keep the date together to ease the calculation, it'll be OK too.
This elapsed time will be used for calculating operating ratio for a manufacturing line.
Any kind of advice is much appreciated.[/code]
Both StartTime & EndTime are bound text boxes (datetime data type) in a form.
The table contains another field (RegisteredOn) which has a default value of =Date().
My first attempt was using DateDiff. But the result is not correct in some situations like this:
StartTime : 08:00 PM
EndTime : 01:30 AM
Code:
?DateDiff("s", .StartTime , .EndTime )
-69300
If I include date with the recorded time, DateDiff may work, but it's not desirable for me to type something like 2021/09/10 08:00 PM each time.
If there's a way to let me type only minutes and seconds but keep the date together to ease the calculation, it'll be OK too.
This elapsed time will be used for calculating operating ratio for a manufacturing line.
Any kind of advice is much appreciated.[/code]
Last edited: