I have a table called proc.dbf and child table called palias.dbf
I'm trying to return all records for a lookup from the proc.dbf and palias (dcode) is what they are common on. The query below will do that. BUT...always a but.. I'm filtering the query on the proc.dbf if the screen option = RADIOLOGY. This works on the top sql, but since the child table doesn't have that field, it returns all records from the palias table. So my question is how can I re-write this query to also apply the filter to the palias?
Thanks for any help:
gcProcDBF=[..\proc.dbf]
gcPalias=[..\palias]
SELECT iif(!empty(localdesc),localdesc,DESCRIPTIO),PADR(dcode,15) AS dcode1 ;
FROM &gcProcDBF ;
where screenoption=[RADIOLOGY] ;
UNION ALL ;
SELECT procalias, PADR(dcode,15) AS dcode1 ;
FROM &gcPAlias ;
ORDER BY 1 ;
INTO ARRAY RADPROCS