Hallo Hansi,
probiers mal ungefähr so:
SELECT AVG(datum) FROM tabelle WHERE datum >= :datum_ab
In Delphi:
Delphi-Quellcode:
qry.sql.text := 'SELECT AVG(datum) FROM tabelle WHERE datum >= :datum_ab' ;
qry.ParamByName(datum_ab).AsDateTime := date - 5 ;
qry.open ;