T
turks67 via AccessMonster.com
How do I convert decimal to time for eg
55.80 to 56:20
25.70 to 26:10
55.80 to 56:20
25.70 to 26:10
Huh? What convention do you use here?How do I convert decimal to time for eg
55.80 to 56:20
25.70 to 26:10
How do I convert decimal to time for eg
55.80 to 56:20
25.70 to 26:10
TedMi said:I'm assuming you want to convert a value representing 55 hrs 80 min to 56
hrs 20 min (or, equivalently, 55 min 80 sec to 56 min 20 sec).
IF (OriginalValue - Int(OriginalValue) >= .60) Then
NewValue=OriginalValue + .4
Else
NewValue=OriginalValue
EndIF
If the Original Value need not be kept, do this instead:
IF (OrignalValue - Int(OriginalValue) >= .60) Then OriginalValue =
OriginalValue + .4
If that is not what you intended, please provide more information.
-TedMi
John W. Vinson said:How do I convert decimal to time for eg
55.80 to 56:20
25.70 to 26:10
So you're working in the hexadecimal system, where the number before the
decimal point is hours and the portion after is minutes? Do note that if
you're planning to use an Access Date/Time field, it does NOT support hour
values over 23; a Date/Time field is actually a double float count of days
and
fractions of a day since midnight, December 30, 1899, so 26:10 is actually
stored as #12/31/1899 02:10:00am#.
That said - you can construct a *text string* (not a Date/Time) as you
describe with an expression like
Int([yourfield]) + (([yourfield] - Int([yourfield]) * 100) \ 60 & ":" &
([yourfield] - Int([yourfield]) * 100 MOD 60