I need record from table1 where field matches the data of other table OR belongs to some date.
Select field
from table1
into table result1
where ldate = p_date.
Select field
from table1
into table result2
for all entires in table2
where field1 = table2-field1
Loop at result1.
result-field = result1-field.
append result.
Endloop.
Loop at result2.
result-field = result2-field.
append result.
Endloop.
Please suggest.