October 26th, 2000, 01:51 PM
I realize this might not be the correct place to ask, but I need some help formatting the following:
I take end_time and subtract start_time.
This of course gives me a loooonnnggg decimal number.
I need to format 1.5 hours to read 1:30.
October 27th, 2000, 06:03 AM
This not the right place to be posting access questions. I assume you are using Access as a learning tool before you migrate to MySQL! but since you are here:
make sure that your datatypes are "short time" (24:00 hour clock).
Here is a vb example of time duration:
' eg StartTime 23:00 , EndTime = 01:00
' If the times span midnight add 24 to enddtime eg (01:00 + 24:00) - 23:00 = 2 hours
If txtEndTime < "12:00:00" And txtStartTime > "12:00:00" Then
txtEndTime = DateAdd("h", 24, txtEndTime)
'This only works with durations of less than 24 hours
txtDuration = txtEndTime - txtStartTime
[This message has been edited by eaamj01 (edited October 27, 2000).]