Skip to Content
0
Former Member
Sep 07, 2009 at 07:29 PM

Colocar Parametros en Consulta de Query Manager

2146 Views

Saludos a la comunidad, necesito ayuda para colocar parametros a una consulta hecha en query manager para mostrar las ordenes de compra creadas, la idea es poder filtrar el resultado del query por empleado del departamento de ventas y por el rango de fechas de los documentos.

La consulta es la siguiente:

SELECT T1.DocEntry AS 'DocEntry Prel', T2.DocNum AS 'Num Doc DEF', t3.prjname as 'Proyecto', T2.[CardName] AS 'Nombre de deudor/acreedor', T2.[TaxDate] AS 'Fecha de documento', T2.[BaseAmnt] AS 'Importe base', T2.[DiscSum] AS 'Descuento total', T2.[DocTotal] AS 'Total del documento', T2.[U_Condicion_Entrega] AS 'Condiciones de Entrega', T2.[U_Criticidad] AS 'Criticidad', T5.[Descr] AS 'Solicitante', T4.[SlpName] AS 'Comprador', T6.WDDCode, T8.U_Name AS 'Usuario Aprobador',

CASE T7.Status WHEN 'W' THEN 'En Espera' WHEN 'Y' THEN 'Aprobado' WHEN 'N' THEN 'Rechazado' END 'Decisión', T7.Remarks, T7.UpdateDate AS 'Fecha Aprobación',

T7.UpdateTime AS 'Hora Aprobación'

FROM ODRF AS T1, OPOR AS T2, OPRJ as T3, OSLP as T4, OWDD AS T6, WDD1 AS T7, OUSR AS T8, UFD1 AS T5

WHERE T1.DocNum = T2.DocEntry AND

T1.DocEntry = T2.draftKey AND

T2.DocStatus = 'O' AND

T1.DocStatus = 'C' AND

T2.project=T3.prjcode AND

T2.slpcode=T4.slpcode AND

T2.Docentry=T6.Docentry AND

T6.WDDCode=T7.WDDCode AND

T7.UserID=T8.UserID AND

T2.[U_Solicitante]=T5.[FldValue] AND

T5.[FieldID]=29 AND

T5.tableid='ODRF'

Agradezco la ayuda!

Miguel