The statement:
Code: Select all
SELECT @DATE( @MID( PF_CORP_ACTION, 12, 4 ), @MID( PF_CORP_ACTION, 9, 2 ), @MID( PF_CORP_ACTION, 6, 2 ) )
FROM X
WHERE ( ( @LEFT(PF_CORP_ACTION, 5 ) = 'SPLIT' )) ;
Code: Select all
DT
===========
08-APR-2020
Code: Select all
SELECT @DATE( @MID( PF_CORP_ACTION, 12, 4 ), @MID( PF_CORP_ACTION, 9, 2 ), @MID( PF_CORP_ACTION, 6, 2 ) ) as dt
FROM X
WHERE ( ( @LEFT(PF_CORP_ACTION, 5 ) = 'SPLIT'
AND @DATE( @MID( PF_CORP_ACTION, 12, 4 ), @MID( PF_CORP_ACTION, 9, 2 ), @MID( PF_CORP_ACTION, 6, 2 ) ) < 2020-03-31 ) ) ;
Since it is in an AND and evaluated left to right, if the first predicate fails, the second should not be evaluated.
Or am I doing something wrong?