Isto pišem iz glave, ali trebalo bi da razumeš poentu:
Code (delphi):
var
sifre: String;
...
sifre := RichEdit1.Lines[0];
if RichEdit1.Lines.Count > 1 then
for i := 1 to RichEdit1.Lines.Count - 1 do
sifre := sifre + ', ' + RichEdit1.Lines[i];
Query1.Close;
Query1.SQL := 'SELECT SUM(CAST(ukupno AS FLOAT)) FROM statistika WHERE sifra IN (' + sifre + ')';
Query1.Open;
Možda bi bilo bolje da jednostavno koristiš običnu TEdit komponentu i da u nju upisuješ željene šifre razdvojene zarezom. Zatim to jednostavno dodaš u kveri i rešio si problem. Ne razumem zašto koristiš TRichEdit za ovako nešto ako ti samo treba unos niza numeričkih vrednosti.
"There is a theory which states that if ever anybody discovers exactly what the
Universe is for and why it is here, it will instantly disappear and be replaced by
something even more bizarre and inexplicable. There is another theory which states
that this has already happened."
-- Douglas Adams