Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Unir Datos

0 Kudos

Estimados,

necesito una pequeña ayuda, acabo de unir 2 consultas (entrega y devolución) el problema que tengo es que al ejecutar la consulta algunos registros me salen "duplicados" (uno por lo que se entrego y otro por la cantidad que se devolvió), necesito juntar estos 2 datos dejando Numero de documento, Cantidad entregada, Cantidad no entregada.

saludos

SELECCIONE T0. [DocDate], T0. [NumAtCard], T1. [FreeTxt], suma (T1. [Cantidad]), 0 DE ODLN T0 INNER JOIN DLN1 T1 ON T0. [DocEntry] = T1. [DocEntry] WHERE T0 . [DocDate]> = [% 0] AND T0. [DocDate] <= [% 1] GROUP BY T0. [NumAtCard], T0. [DocDate], T1. [FreeTxt] UNION ALL SELECT T0. [DocDate], T0. [NumAtCard], T1. [FreeTxt], 0, SUM (T1. [Cantidad]) DESDE ORDN T0 INNER JOIN RDN1 T1 EN T0. [DocEntry] = T1. [DocEntry] WHERE T0. [DocDate]> = [ % 0] Y T0. [DocDate] <= [% 1] GROUP BY T0. [DocDate], T0. [NumAtCard], T1. [FreeTxt]

0 REPLIES 0