Query1.Sql.Add ('where firma ="'+ DBLookupComboBox1.text+'"and DatumDospjeca >= "'+ DateEdit1.Text +'"'+' and DatumDospjeca<='+'"'+ DateEdit2.Text +'" Group By SIFRA,Naziv');
Code:
Query1.SQL.Add('WHERE (firma = :naziv_firme) AND (DatumDospjeca BETWEEN :DatumMin AND :DatumMax) ');
Query1.SQL.Add('GROUP BY SIFRA, Naziv');
Query1.Parameters.ParamByName('naziv_firme').Value := DBLookupComboBox1.text;
Query1.Parameters.ParamByName('DatumMin').Value := DateEdit2.Text;
Query1.Parameters.ParamByName('DatumMax').Value := DateEdit1.Text;
Ovo bi trebalo da ti zavrsi posao. Mozda ces samo morati da permutujes DatumMin i DatumMax, da bi dobio ispravne rezultate...