Fórum Erro ao executar o relatório #352165
21/01/2008
0
Bom, tá dando esse erro
Esses são os dados do relatório
[quote:7c1fa0c632][/quote:7c1fa0c632]
SQL Error code =-104 Token Uknowm - line 1, char 14
1´.
Esses são os dados do relatório
procedure TFrmRelCaixa.spbexiClick(Sender: TObject); begin If DtmIza.QryRelEmp.Active = True Then DtmIza.QryRelEmp.Active := False ; With DtmIza.QryRelEmp do Begin Close; Sql.Clear; Sql.Add (´Select Codigo, Empresa, Cnpj From Empresa´); Open; end; With DtmIza.QryIza Do begin Close; Sql.Clear; Sql.Add(´Select Aluno, Valor, Vencimento, Emissao, Pagamento, Historico, Historico1, Tipo From Lancamento´); Sql.Add(´where (Pagamento = :d1)´); //and (Pagamento = :d2)´); ParambyName(´d1´).value := FormatDateTime (´dd/mm/yyyy´ , StrToDate (TxtDataIn.Text)); // ParambyName(´d2´).value := FormatDateTime (´dd/mm/yyyy´ , StrToDate (TxtDatfin.Text)); Open; End ; With qryTotal Do begin Close; Sql.Clear; Sql.Add ( ´ select first 1 (select sum(valor) ´ ) ; Sql.Add ( ´ from lancamento ´ ) ; Sql.Add ( ´ where tipo = 1 ´ ) ; Sql.Add ( ´ and pagamento = :d1), ´ ) ; Sql.Add ( ´ (select sum(valor) ´ ) ; Sql.Add ( ´ from lancamento ´ ) ; Sql.Add ( ´ where (tipo = 0 or ´ ) ; Sql.Add ( ´ Tipo = 2) ´ ) ; Sql.Add ( ´ and pagamento = :d1), ´ ) ; Sql.Add ( ´ ´ ) ; Sql.Add ( ´ (select sum(valor) ´ ) ; Sql.Add ( ´ from lancamento ´ ) ; Sql.Add ( ´ where tipo = 1 ´ ) ; Sql.Add ( ´ and pagamento = :d1) - ´ ) ; Sql.Add ( ´ ´ ) ; Sql.Add ( ´ (select sum(valor) ´ ) ; Sql.Add ( ´ from lancamento ´ ) ; Sql.Add ( ´ where (tipo = 0 or ´ ) ; Sql.Add ( ´ Tipo = 2) ´ ) ; Sql.Add ( ´ and pagamento = :d1) ´ ) ; Sql.Add ( ´ ´ ) ; Sql.Add ( ´ from lancamento ´ ) ; ParambyName(´d1´).value := FormatDateTime (´dd/mm/yyyy´ , StrToDate (TxtDataIn.Text)); Open; End; If DtmIza.QryIza.RecordCount = 0 Then Begin ShowMessage(´Sem dados para relatório!´); exit; End Else With TFrmCaixa.Create(Application) Do Try QuickRep1.Preview; Finally Free; end; close; end;
Robinhocne
Curtir tópico
+ 0
Responder
Posts
21/01/2008
Edilcimar
Sql.Add(´Select Aluno, Valor, Vencimento, Emissao, Pagamento, Historico, Historico1, Tipo From Lancamento ´);
Sql.Add(´where (Pagamento = :d1) ´);
tente assim, veja que inclui espaços
Sql.Add(´where (Pagamento = :d1) ´);
tente assim, veja que inclui espaços
Responder
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)