1
I have a problem adding a line to my SQL LIST OF BOUNDS (3)
Delphi :
clausulaIn := 'AND A.NNUMEMAPAF IN (0';
while not Q_Mapas.Eof do
begin
clausulaIn := clausulaIn + ',' + IntToStr(Q_MapasNNUMEMAPAF.AsInteger);
Q_Mapas.next;
end;
clausulaIn := clausulaIn + ')';
qryAgrupaValoresPorData.Close;
qryAgrupaValoresPorData.SQL[03] := clausulaIn;
qryAgrupaValoresPorData.ParamByName('EMPRESA').AsInteger := Form_Menu.Q_EmpresasNCODIGOEMPRE.AsInteger;
qryAgrupaValoresPorData.Open;
my SQL:
SELECT A.DDTPGMVFMF DT_PAGTO, SUM(A.NVLPGMVFMF)
FROM CORMVFMF A
WHERE A.NCODIGOEMPRE = 2--:EMPRESA
AND A.NNUMEMAPAF IN (0)
GROUP BY A.DDTPGMVFMF
ORDER BY A.DDTPGMVFMF
What’s the matter with you?
– Ismael
@Ismael LIST OF BOUNDS (3)
– rodrigo.oliveira
See if this is it (remove 0): qryAgrupaValoresPorData.SQL[3] := clausulaIn;
– Wendel Rodrigues
You didn’t solve it, it was a mistake.
– rodrigo.oliveira
The way you are entering SQL is incorrect. You should use one of these ways: Query.SQL.Add('SQL_A_SER_INSERIDO'); // Add at end Query.SQL.Insert(Index, 'SQL_A_SER_INSERIDO'); // Add at desired line
– Wendel Rodrigues
@Wendelrodrigues sorry for the delay is that I changed the code again today. So I could solve I don’t know why else the query was empty.
– rodrigo.oliveira