Skip to Content
avatar image
Former Member

Error on time formula that has been working

We have a formula that had been working till now. but I dont see how to debug, how to see what the data issue is?

IF istime(Left(Split({qryPtWaitingTme_.SCHED_TIMESTART}, ' ')[2],8)) then Time(Left(Split({qryPtWaitingTme_.SCHED_TIMESTART}, ' ')[2],8))

when running now it gives this message:

' A subscript must be between 1 and the size of the array' without seeing the data, how can i change the above code to handle this error>

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Feb 28 at 07:03 PM

    Hi Paul,

    This could very well be caused due to NULL values.

    Modify the formula to:

    IF {qryPtWaitingTme_.SCHED_TIMESTART} = '' THEN
    Time(0,0,0)
    Else IF istime(Left(Split({qryPtWaitingTme_.SCHED_TIMESTART}, ' ')[2],8)) then 
    Time(Left(Split({qryPtWaitingTme_.SCHED_TIMESTART}, ' ')[2],8))

    Also, make sure to select "Default Values for Null" from the drop-down in the formula editor. (The default is set to "Exceptions for Nulls").

    -Abhilash

    Add comment
    10|10000 characters needed characters exceeded