Buenas tardes;
Me pueden orientar que instrucción puedo tener mal en este query, lo ejecuto en el Generador de consultas de SAP BO y no me indica error, pero tampoco aparece información, si ejecuto cada SELECT
por separado, funcionan, pero juntos al UNION ALL no y si quito la barra de mensajes, me aparece el error en rojo pero me indica error de sintaxis en UNION ALL
Este es el Script:
SELECT T0.[DocDate], T1.[ItemCode], T1.[Dscription], T1.[Quantity], T1.[Price], T1.[Quantity]*T1.[Price] as "Total", T2.[BWeight1] as "Peso Unitario", (T1.[Quantity]*T2.[BWeight1]) as "Total base peso", T0.[Comments]
FROM OIGE T0 INNER JOIN IGE1 T1 ON T0.[DocEntry] = T1.[DocEntry] INNER JOIN OITM T2 ON T1.[ItemCode] = T2.[ItemCode] WHERE T1.[BaseRef] =[%0] and T0.[CANCELED]='N' order by T1.[ItemCode]
UNION ALL
SELECT T3.[DocDate], T4.[ItemCode], T4.[Dscription], T4.[Quantity], T4.[Price], T4.[Quantity]*T4.[Price] as "Total", T5.[BWeight1] as "Peso Unitario", (T4.[Quantity]*T5.[BWeight1]) as "Total base peso", T3.[Comments]
FROM OIGN T3 INNER JOIN IGN1 T4 ON T3.[DocEntry] = T4.[DocEntry] INNER JOIN OITM T5 ON T4.[ItemCode] = T5.[ItemCode] WHERE T4.[BaseRef] =[%0] and T3.[CANCELED]='N' order by T4.[ItemCode]
Gracias