on 05-03-2017 11:33 PM
Estimados todos, buenas tardes
Con una consulta, tengo el siguiente código que me funciona bien sin la clausula Where, sin embargo, al colocarsela ya no me da ningún resultado.
Agradezco me puedan hacer ver en donde estoy fallando, para hacer la corrección
Saludos
Marco
SELECT T0.DocEntry, T0.[DocNum], T0.[DocDate], T0.[CardCode], T0.[CardName], T1.[ItemCode], T1.[Dscription], T1.[Quantity], T1.[WhsCode], T2.[Name], T3.[Name] FROM ODLN T0
INNER JOIN DLN1 T1 ON T0.[DocEntry] = T1.[DocEntry]
INNER JOIN dbo.[@DEPARTAMENTOS] T2 ON T0.U_Departamento = T2.Code
INNER JOIN dbo.[@MUNICIPIOS] T3 ON T0.U_Municipio = T3.Code
Where T0.[DocNum] Between [%0] and [%1]
Gracias Johan.
El código original lo he corrido directamente en SQL Server y si genera información.
Probé tu sugerencia pero sigue sin generar datos.
Saludos
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hola Marco,
No hay nada mal con su consulta original. Si no obtiene resultados, entonces no está introduciendo los números de documento correctos o no hay entradas en las tablas de usuario para los números de documento dados. Puedes probar esto así:
SELECT T0.DocEntry
, T0.[DocNum]
, T0.[DocDate]
, T0.[CardCode]
, T0.[CardName]
, T1.[ItemCode]
, T1.[Dscription]
, T1.[Quantity]
, T1.[WhsCode]
/*, T2.[Name]
, T3.[Name]*/
FROM ODLN T0
INNER JOIN DLN1 T1 ON T0.[DocEntry] = T1.[DocEntry]
/*INNER JOIN dbo.[@DEPARTAMENTOS] T2 ON T0.U_Departamento = T2.Code
INNER JOIN dbo.[@MUNICIPIOS] T3 ON T0.U_Municipio = T3.Code*/
WHERE T0.[DocNum] Between [%0] and [%1]
Saludos,
Johan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Igual he usado
Where T0.[DocNum]>= [%0] and T0.[DocNum]< [%1]
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
98 | |
12 | |
10 | |
6 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.