You are not logged in.
Pages: 1
I am not able to add a parameter with the following sql date, displays the following error: PSQLException: ERROR: invalid input syntax for type date: "" Posição: 1751
SELECT
F1.*,
F10.*,
F12.*,
F14.*,
F21.*,
G15.DS_RAZAO_SOCIAL AS nomeEmpresa,
F35.DS_TIPO_COBRANCA as descricaoTipoCobranca,
P2.ds_parceiro as nomeParceiro,
P1.ds_parceiro AS nomePortador,
P3.ds_parceiro as nomeGestor,
C1.DS_CONTA AS nomeConta,
C1.DS_CLASSIFICACAO AS classificacaoConta,
C1_1.DS_CONTA AS nomeContaCaixa,
C1_1.DS_CLASSIFICACAO AS classificacaoContaCaixa,
case
when F13.CD_CONTA_CORRENTE is not null
OR F72.CD_CONTA_CORRENTE is not null then 'CH_DUPTER'
else ''
end as tipodup
FROM FIN0021 F21 LEFT JOIN FIN0001 F1 ON (F1.CD_CONTA_CORRENTE = F21.CD_CONTA_CORRENTE)
LEFT JOIN FIN0010 F10 ON (F10.CD_CONTA_CORRENTE = F21.CD_CONTA_CORRENTE)
LEFT JOIN FIN0012 F12 ON (F12.CD_CONTA_CORRENTE = F21.CD_CONTA_CORRENTE)
LEFT JOIN FIN0013 F13 ON (F13.CD_CONTA_CORRENTE = F21.CD_CONTA_CORRENTE)
LEFT JOIN FIN0014 F14 ON (F14.CD_CONTA_CORRENTE = F21.CD_CONTA_CORRENTE)
LEFT JOIN FIN0072 F72 ON (F72.CD_CONTA_CORRENTE = F21.CD_CONTA_CORRENTE)
LEFT JOIN FIN0011 F11 ON (F11.CD_CONTA_CORRENTE = F21.CD_CONTA_CORRENTE)
LEFT JOIN FIN0108 F108 ON (F108.CD_CONTA_CORRENTE = F21.CD_CONTA_CORRENTE)
LEFT JOIN GER0015 G15 ON (G15.CD_EMPRESA = F1.CD_EMPRESA)
LEFT JOIN FIN0035 F35 ON (F35.CD_TIPO_COBRANCA = F10.CD_TIPO_COBRANCA)
LEFT JOIN PAR0001 P2 ON (P2.CD_PARCEIRO = F1.CD_PARCEIRO)
LEFT JOIN PAR0001 P1 ON (P1.CD_PARCEIRO = F10.CD_PORTADOR)
LEFT JOIN PAR0001 P3 ON (P3.CD_PARCEIRO = F12.CD_GESTOR)
LEFT JOIN CTB0001 C1 ON (C1.CD_CONTA = F21.CD_CONTA_OPERACIONAL)
LEFT JOIN CTB0001 C1_1 ON (C1_1.CD_CONTA = F21.CD_CONTA_CAIXA)
WHERE (CAST(F21.DT_OCORRENCIA AS DATE) BETWEEN ${dataInicial} AND ${dataFinal})
AND F10.CD_CONTA_CORRENTE IS NOT NULL
AND F11.CD_CONTA_CORRENTE IS NULL
AND F108.CD_CONTA_CORRENTE IS NULL
AND NOT EXISTS (SELECT 1 FROM FIN0116 negoc WHERE negoc.cd_cobranca_negociacao = F1.cd_conta_corrente)
AND F13.CD_CONTA_CORRENTE IS NULL
AND F72.CD_CONTA_CORRENTE IS NULL
AND F21.ID_TIPO_LANCAMENTO IN ('L')
AND F21.ID_FORMA_PAGAMENTO IN ('0')
Offline
Hi Leonardo,
this problem is not caused by the parameter, but by the cast in your query. It looks like you are trying to cast a column to date that has empty fields.
Cheers,
Thorsten
Pages: 1