Skip to Content
author's profile photo Former Member
Former Member

consulta total de despachos por orden de venta

Tengo este Query que muestra estos datos: necesito que en una columna adicional me muestre el total de lo despachado por # de Orden de Venta.

SELECT T0.DocNum N' # Pedido', T0.docdate N'Fecha de contabilización',U_FechaIPro N'Fecha de Inicio de Proyecto', T0.CardCode N'Cod. Cliente', T1.CardName N'Cliente',T0.Doctotal - paidtodate N' Pendiente a Facturar', T2.SlpName N'Vendedor'

,CntctPrsn,cardfname N'Nombre Comercial',U_Solucion,U_CT N' Supervisor',U_CoCompras N' Condiciones Especiales de Garantía',U_CL N' Project Manager',U_TL N' Encargado', U_FP N' Condiciones de Pago',u_suc N'Sucursal',u_comen N'Comentarios adicionales'


INNER JOIN OSLP T2 ON T0.SlpCode = T2.SlpCode

WHERE T0.DocStatus = N'o' and T0.CardCode NOT Like '%%0117%%'


Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on May 05, 2011 at 08:37 PM

    Necesitas basarte en la tabla dln1, haz un left join a dicha tabla donde el docetnryde la rdr1 sea igual al baseentry de la dln1 (detalle entregas) y el baseline de la dln1 sea igual al linenum de la rdr1, con esto sabras cuanto se entrego o despacho de tu orden de venta

    agrega el join ahi mismo a tu query

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.