Skip to Content
0
Former Member
Sep 27, 2012 at 10:24 PM

Left Join Parameter

39 Views

Hello.

I'd like to make a report from a query I've already made, the problem is with the parameters, I know how to put parameters in Crystal but not the parameters inside a left join clause, here is the query:

SELECT DISTINCT T0.CardCode,

T0.U_CR CR,

T0.Name Tienda,

T0.U_CIUDAD Ciudad,

T0.Address Direccion,

T1.U_fecha

T1.U_hora

T1.U_Proveedor

ISNULL(T4.firstName,'') + ' ' + ISNULL(t4.middleName,'') + ' ' + ISNULL(t4.lastName,'') Tecnico,

T5.descript Zona,

isnull(T1.callID,0) AS 'ID llamada'

FROM OCPR T0

LEFT JOIN OSCL T1 ON T0.CntctCode = T1.contctCode

AND T1.U_Fecha >= [%0] AND T1.U_Fecha <= [%1]

AND T1.origin = 3 AND T1.callType = 36 AND T1.problemTyp = 5

LEFT JOIN OINS T2 ON T1.insID = T2.insID

LEFT JOIN CRD1 T3 ON T3.CardCode = T0.CardCode

LEFT JOIN OTER T5 ON T5.territryID = T2.territory

LEFT JOIN OHEM T4 ON T4.empID = T1.technician

Where

T0.CardCode = '[%2]' AND

T0.U_CR IS NOT NULL

ORDER BY

isnull(T1.callID,0)

This is the query that I use in SAP B1, how can I add the T1.U_Fecha parameters to Crystal, because If I use them in the Where clause its gonna mess the results.

Thanks in advance hope you can help me.