Hi all,
I am working on a report for tracking productivity in our production area. The time field's I am using from our live data are in 8-digit number format. I have a formula below that works for converting the 7-8 digit number value to a date our {BVE_PHASE_DTL.START_TIME} field, however when I try to use this same formula for the {BVE_PHASE_DTL.END_TIME} field, it produces the error "Bad time format string." I am certain this is because there are Null Values in the {BVE_PHASE_DTL.END_TIME} tables. I don't mind if these null fields stay blank when the report runs as long as I don't get the "Bad time format string" error that prevents the report from running.
Here is an example of the formula that I am successfully using for the {BVE_PHASE_DTL.START_TIME} field:
StringVar sMyTime := ToText({BVE_PHASE_DTL.START_TIME}, 0, "");
IF Len(sMyTime) = 8 Then
cTime(sMyTime[1 to 2] & ":" & sMyTime[3 to 4] & ":" & sMyTime[5 to 6])
Else
cTime(sMyTime[1] & ":" & sMyTime[2 to 3] & ":" & sMyTime[4 to 5]);
This formula will display the numerical START_TIME field value of 18425770 as 6:42:57PM, or 8472173 will display as 8:47:21AM, however as soon as it encounters a null value I get the "Bad time format string" error.
If anyone can suggest a method to handle the null values without error, I'd be greatfull for the help and lesson!
Colin
I am working on a report for tracking productivity in our production area. The time field's I am using from our live data are in 8-digit number format. I have a formula below that works for converting the 7-8 digit number value to a date our {BVE_PHASE_DTL.START_TIME} field, however when I try to use this same formula for the {BVE_PHASE_DTL.END_TIME} field, it produces the error "Bad time format string." I am certain this is because there are Null Values in the {BVE_PHASE_DTL.END_TIME} tables. I don't mind if these null fields stay blank when the report runs as long as I don't get the "Bad time format string" error that prevents the report from running.
Here is an example of the formula that I am successfully using for the {BVE_PHASE_DTL.START_TIME} field:
StringVar sMyTime := ToText({BVE_PHASE_DTL.START_TIME}, 0, "");
IF Len(sMyTime) = 8 Then
cTime(sMyTime[1 to 2] & ":" & sMyTime[3 to 4] & ":" & sMyTime[5 to 6])
Else
cTime(sMyTime[1] & ":" & sMyTime[2 to 3] & ":" & sMyTime[4 to 5]);
This formula will display the numerical START_TIME field value of 18425770 as 6:42:57PM, or 8472173 will display as 8:47:21AM, however as soon as it encounters a null value I get the "Bad time format string" error.
If anyone can suggest a method to handle the null values without error, I'd be greatfull for the help and lesson!
Colin