Not sure how to word this but is it possible to take the result of a CASE statement:
select a.field5,
(case when a.field1 ='HI' then substr(a.field2,6,8) else substr(a.field3,6,8) end) as newfield
and use that result in the where clause:
from table1 a, table2 b
where a.field4 = 'TODAY' and newfield = b.field1
select a.field5,
(case when a.field1 ='HI' then substr(a.field2,6,8) else substr(a.field3,6,8) end) as newfield
and use that result in the where clause:
from table1 a, table2 b
where a.field4 = 'TODAY' and newfield = b.field1