AnsweredAssumed Answered

SQL Query Report

Question asked by Jeremiah White on Feb 5, 2021
Latest reply on Feb 5, 2021 by Evan Stanek

Is it possible to gather fields from two tables in SWE? We are trying to use a UNION statement and it will not work. We want vew_cable_ex and vew_manufacturerparts_ex in the same report. Each time I apply and test, the UNION and everything after disappears.

 

SELECT DISTINCT

bom_manufacturer
,bom_reference
,bom_tra_0_l1
,bom_use_data0
,com_tag
,bun_tag
,com_type
,loc_text
,vcomcom_com_tag
,1 AS %ELEMENT_COUNT%


FROM

vew_manufacturerparts_ex


WHERE

bun_id = %CUR_BUNDLE_ID%
AND bom_assemblyid = -1
AND bom_objecttype != 9


ORDER BY vcomcom_com_tag ASC,com_tag ASC


UNION


SELECT DISTINCT

cab_tag


FROM

vew_cable_ex


WHERE

vew_cable_ex.cab_tag != ]][[

Outcomes