on 12-27-2011 9:42 PM
Tengo problema con el siguiente querie:
-
-
GO
/****** Object: StoredProcedure .[SBO_SP_VTH_PagosPorFecha] Script Date: 12/27/2011 16:32:17 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE .[SBO_SP_VTH_PagosPorFecha]
@FECHA1 DATETIME, @FECHA2 DATETIME
AS
BEGIN
select
OVPM.DocNum as NumeroPago,
OVPM.DocDate as Fecha,
OPCH.CardCode as CodigoCL,
OPCH.CardName as Cliente,
OPCH.DocNum as NumeroSAP,
OPCH.NumAtCard as NumeroDoc,
VPM2.SumApplied as TotalFactSoles,
VPM2.AppliedFC as TotalFactDolares,
OVPM.DocCurr as MonedaPago,
OVPM.DocTotal as PagoSoles,
OVPM.DocTotalFC as PagoDolares
FROM OVPM INNER JOIN VPM2 ON OVPM.DocEntry = VPM2.DocNum
INNER JOIN OPCH ON ((VPM2.DocEntry = OPCH.DocEntry) and (VPM2.InvType = '18'))
WHERE OVPM.canceled = 'N' and OVPM.UserSign = '12'
and OVPM.DocDate >= @FECHA1 and OVPM.DocDate <= @FECHA2
UNION
select
OVPM.DocNum as NumeroPago,
OVPM.DocDate as Fecha,
ORPC.CardCode as CodigoCL,
ORPC.CardName as Cliente,
ORPC.DocNum as NumeroSAP,
ORPC.NumAtCard as NumeroDoc,
-VPM2.SumApplied as TotalFactSoles,
-VPM2.AppliedFC as TotalFactDolares,
OVPM.DocCurr as MonedaPago,
OVPM.DocTotal as PagoSoles,
OVPM.DocTotalFC as PagoDolares
FROM OVPM INNER JOIN VPM2 ON OVPM.DocEntry = VPM2.DocNum
INNER JOIN ORPC ON ((VPM2.DocEntry = ORPC.DocEntry) and (VPM2.InvType = '19'))
WHERE OVPM.canceled = 'N' and OVPM.UserSign = '12'
and OVPM.DocDate >= @FECHA1 and OVPM.DocDate <= @FECHA2
order by Fecha, NumeroPago
END
Es un reporte que realize para mostrar los pagos que stan pendientes entre fechas. Funcionaba bien en SÄP 2007. AHora con la migracion al SAP 8.8 no me bota informacion.
NO se si algo me estoy olvidando
Gracias
Hola Luis.
Declara @FECHA1 y @FECHA2 de tipo NVARCHAR(20).
Después del AS pon SET LANGUAGE SPANISH
Espero te sirva.
eroblero
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
5 | |
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.