J
Joe
I have a field that contains time in the 24 hr. format
(and it is a number (long integer) type field.
I want to change it to a TIME field.
The problem is that the field doesn't contain leading
zeros. The formula that I'm using is:
TimeSerial(Left(CStr([test].[AHTime]),2),Mid(CStr([test].
[AHTime]),3,2),Right(CStr([test].[AHTime]),2))
The formula works properly only on fields that contain
data like 114523. I get 11:45:23 AM, which is correct.
Except that if the field is 51301 I get 1/1/1900 3:30:01
AM instead of 05:13:01 AM. Same goes for if I only have a
value of 23, which would be 00:00:23 AM.
How can I get this to work for all possibilities? May be
there is a way to add leading zeros so that the field is
always 6 digits, as it should be? Or perhaps some other
way? Any ideas?
(and it is a number (long integer) type field.
I want to change it to a TIME field.
The problem is that the field doesn't contain leading
zeros. The formula that I'm using is:
TimeSerial(Left(CStr([test].[AHTime]),2),Mid(CStr([test].
[AHTime]),3,2),Right(CStr([test].[AHTime]),2))
The formula works properly only on fields that contain
data like 114523. I get 11:45:23 AM, which is correct.
Except that if the field is 51301 I get 1/1/1900 3:30:01
AM instead of 05:13:01 AM. Same goes for if I only have a
value of 23, which would be 00:00:23 AM.
How can I get this to work for all possibilities? May be
there is a way to add leading zeros so that the field is
always 6 digits, as it should be? Or perhaps some other
way? Any ideas?