Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help with a union
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Help with a union
Miscellaneous
Thread ID:
00666184
Message ID:
00666184
Views:
51
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 
Next
Reply
Map
View

Click here to load this message in the networking platform