I have a method I use to convert our time from a database from military time to "civilian time."
I just ran across one field in a table that has the time stored as:
12:15 instead of 1215 (like the rest of our tables with time).
How can I remove the ":" to make the following formula work?
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"
I just ran across one field in a table that has the time stored as:
12:15 instead of 1215 (like the rest of our tables with time).
How can I remove the ":" to make the following formula work?
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"