SQL Status: HY000
Error code: 1000
syntax error, unexpected $end, expecting BETWEEN or IN or SQL_TOKEN_LIKE
el query es el siguiente
Código:
de antemano muchas gracias SELECT PFA.Numero as 'Factura Numero', Ped.Pedimento, Ped.Clave, Ped.FechaDeEntrada, Ped.Patente, Ped.Aduana, Ped.FechaDePago, Par.ValorEnAduana, Par.ValorEnAduanaPesos, Par.ValorEnAduanaDlls, Ped.TipoDeCambio, Ped.ValorComercial, Par.ValorComercialPesos, Par.ValorComercialDlls, Par.CantidadComercial, Par.CantidadTarifa, Par.UnidadComercial, (SELECT SUM(Tot.Importe) FROM VT_Totales Tot WHERE Tot.Pedimento = Ped.ID AND Tot.ClaveContribucion = 1) as 'DTA', (SELECT SUM(Pcnt.Monto) FROM VT_PartidaContrib Pcnt WHERE Pcnt.Contribucion = 3 AND Pcnt.Partida = Par.ID AND Pcnt.FP=0) AS 'IVA FP_0', (SELECT SUM(Pcnt.Monto) FROM VT_PartidaContrib Pcnt WHERE Pcnt.Contribucion = 3 AND Pcnt.Partida = Par.ID AND Pcnt.FP=5) AS 'IVA FP_5', (SELECT SUM(Tot.Importe) FROM VT_Totales Tot WHERE Tot.Pedimento = Ped.ID AND Tot.ClaveContribucion = 15) as 'PREV', (SELECT SUM(Pcnt.Monto) FROM VT_PartidaContrib Pcnt WHERE Pcnt.Contribucion = 6 AND Pcnt.Partida = Par.ID AND Pcnt.FP=0) AS 'IGI FP_0', (SELECT SUM(Pcnt.Monto) FROM VT_PartidaContrib Pcnt WHERE Pcnt.Contribucion = 6 AND Pcnt.Partida = Par.ID AND Pcnt.FP=5) AS 'IGI FP_5', Par.PagaDTA, Par.MontoIGI, Ped.Partidas, Par.PaisDeOrigen, Par.PaisVendComp, Par.Descripcion FROM VT_Pedimentos Ped INNER JOIN VT_PedimentoFacturas PFA ON (Ped.ID = PFA.Pedimento) INNER JOIN VT_Clientes CTE ON (CTE.ID = Ped.Cliente) INNER JOIN VT_Partidas Par ON (Par.Pedimento = Ped.ID) WHERE ((Ped.Patente = '3890') and Ped.FechaDePago BETWEEN {D '2009-09-01'} AND {D '2009-09-30'} and (CTE.Numero = '240') and (RTRIM(Ped.FirmaPedimento) <> '' AND RTRIM(Ped.FirmaBanco) <> ''))