Registriert seit: 23. Jan 2008
3.686 Beiträge
Delphi 2007 Enterprise
|
AW: Double-Variable in SQL-Statement
21. Aug 2012, 15:10
Parameter! (Dass die so unbekannt sind, erstaunt mich immer wieder.)
Delphi-Quellcode:
sqlNat := 'SELECT DISTINCT land, SUM(gestage) AS tage, SUM(gestage) * 100 / :GesamtTage AS Prozent ' +
'FROM Nations ' +
'GROUP BY land ' ;
MyQuery.SQL.Text := sqlNat;
MyQuery.ParamByName('GesamtTage').AsFloat := GesamtTage;
MyQuery.Open;
"When one person suffers from a delusion, it is called insanity. When a million people suffer from a delusion, it is called religion." (Richard Dawkins)
|