can anyone tell me what im doing wrong? i need to subtract a start time from the current time. the start time formula works but i get an error on the @stop time one.
// Current system time
CurrentDateTime
// @Start Time
numberVar hours;
numbervar minutes;
numberVar seconds;
If Not IsNull( {Job History.sdatetime} ) then
(
hours := toNumber({Job History.sdatetime}[12 to 13] ) * 3600 ;
minutes := toNumber({Job History.sdatetime} [15 to 16 ] ) * 60 ;
seconds := toNumber({Job History.sdatetime}[18 to 19 ] ) ;
hours + minutes + seconds
)
Else 0 ;
// @Stop Time
numberVar hours;
numbervar minutes;
numberVar seconds;
If Not IsNull ({@CurrentTime} ) then
(
hours := toNumber({@CurrentTime}[ 16 to 17 ] ) * 3600 ;
minutes:= toNumber({@CurrentTime}[ 19 to 20 ] ) * 60 ;
seconds := toNumber({@CurrentTime}[ 22 to 23 ] ) ;
hours + minutes + seconds
)
Else 0 ; The error message is "A string or an array of values is required here"
Thanks for your advice / help
// Current system time
CurrentDateTime
// @Start Time
numberVar hours;
numbervar minutes;
numberVar seconds;
If Not IsNull( {Job History.sdatetime} ) then
(
hours := toNumber({Job History.sdatetime}[12 to 13] ) * 3600 ;
minutes := toNumber({Job History.sdatetime} [15 to 16 ] ) * 60 ;
seconds := toNumber({Job History.sdatetime}[18 to 19 ] ) ;
hours + minutes + seconds
)
Else 0 ;
// @Stop Time
numberVar hours;
numbervar minutes;
numberVar seconds;
If Not IsNull ({@CurrentTime} ) then
(
hours := toNumber({@CurrentTime}[ 16 to 17 ] ) * 3600 ;
minutes:= toNumber({@CurrentTime}[ 19 to 20 ] ) * 60 ;
seconds := toNumber({@CurrentTime}[ 22 to 23 ] ) ;
hours + minutes + seconds
)
Else 0 ; The error message is "A string or an array of values is required here"
Thanks for your advice / help