Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Olá pessoal, tdo beleza ?
Gente, gostaria de uma ajuda de vcs, tenho esta instrução sql abaixo:
Select DtFun, Pan, NrFun, NvVdr, QtdPecas, QtdLiq, Perc,
(SELECT SUM(QtdPecas) from tbFundicao
where (DtFun >= '03/28/2007' and DtFun <= '03/28/2007'))AS TOT_PECAS,
(SELECT SUM(QtdLiq) from tbFundicao
where (DtFun >= '03/28/2007' and DtFun <= '03/28/2007'))AS TOT_LIQ
From tbFundicao
where (DtFun >= '03/28/2007' and DtFun <= '03/28/2007')
order by DtFun desc;
Utilizando ela, retorna corretamente os valores no Interbase, mas estou tendo problemas para jogar os dados no Quick Report.
Neste código, retornaria 2 campos com a mesma data, só que no Delphi só me traz um...alguém poderia me ajudar com isto ?
No delphi meu código está assim:
with dm.QPesFund do
begin
Close;
sql.Clear;
sql.Add('Select DtFun, Pan, NrFun, NvVdr, QtdPecas, QtdLiq, Perc,');
sql.Add('(SELECT SUM(QtdPecas) from tbFundicao');
sql.Add('where (DtFun >= :pDtini and DtFun <= :pDtFinal))AS TOT_PECAS,');
sql.Add('(SELECT SUM(QtdLiq) from tbFundicao');
sql.Add('where (DtFun >= :pDtini and DtFun <= :pDtFinal))AS TOT_LIQ');
sql.Add('From tbFundicao');
sql.Add('where (DtFun >= :pDtini and DtFun <= :pDtFinal)order by DtFun desc');
try
if (edmdata1.Date <= edmdata2.Date) then
begin
ParamByName('pDtini').AsDate := edmdata1.Date;
ParamByName('pDtFinal').AsDate := edmdata2.Date;
end;
except
end;
try
Open;
except
end;
end;Carregando comentários...