SharonBrown
Technical User
Below is a formula we use to convert military to civilian time. It works except for one problem, any time between 00:00 and 00:14 does not show 12:00 am or 12:14 am, it give
00:14. I need it to show Civilian time.
Any suggestions?
WhilePrintingRecords ();
StringVar szTime;
if({CASE_INFORMATION.case_toi} = " " or IsNull ({CASE_INFORMATION.case_toi})) or Left(ToText({CASE_INFORMATION.case_toi}) ,2) = "0"
then
szTime:=" "
else
If(ToNumber ({CASE_INFORMATION.case_toi})) >= 1200
then If(ToNumber ({CASE_INFORMATION.case_toi}) >= 1259 and ToNumber ({CASE_INFORMATION.case_toi}) < 2200)
then szTime:=Picture(ToText ((ToNumber ({CASE_INFORMATION.case_toi}) -1200),0,"","" ,"X:XX pm"
else If(ToNumber ({CASE_INFORMATION.case_toi}) >= 2200)
then szTime:=Picture(ToText ((ToNumber ({CASE_INFORMATION.case_toi}) -1200),0,"","" ,"XX:XX pm"
else szTime:= Picture({CASE_INFORMATION.case_toi}, "XX:XX pm"
else szTime:= Picture({CASE_INFORMATION.case_toi}, "XX:XX am"
00:14. I need it to show Civilian time.
Any suggestions?
WhilePrintingRecords ();
StringVar szTime;
if({CASE_INFORMATION.case_toi} = " " or IsNull ({CASE_INFORMATION.case_toi})) or Left(ToText({CASE_INFORMATION.case_toi}) ,2) = "0"
then
szTime:=" "
else
If(ToNumber ({CASE_INFORMATION.case_toi})) >= 1200
then If(ToNumber ({CASE_INFORMATION.case_toi}) >= 1259 and ToNumber ({CASE_INFORMATION.case_toi}) < 2200)
then szTime:=Picture(ToText ((ToNumber ({CASE_INFORMATION.case_toi}) -1200),0,"","" ,"X:XX pm"
else If(ToNumber ({CASE_INFORMATION.case_toi}) >= 2200)
then szTime:=Picture(ToText ((ToNumber ({CASE_INFORMATION.case_toi}) -1200),0,"","" ,"XX:XX pm"
else szTime:= Picture({CASE_INFORMATION.case_toi}, "XX:XX pm"
else szTime:= Picture({CASE_INFORMATION.case_toi}, "XX:XX am"