You should be using AsDateTime
in your Params
setting code.
Form1.ABSQuery1.SQL.Text:='DELETE FROM LOG WHERE status = ''YES'' and DATE BETWEEN :d1 and :d2';
Form1.ABSQuery1.Params.ParamByName('d1').AsDateTime :=cxDateEdit1.Date;
Form1.ABSQuery1.Params.ParamByName('d2').AsDateTime :=cxDateEdit2.Date;
Form1.ABSQuery1.ExecSQL;
Using Value
converts the cxDateEdit1.Date
to a generic string format for assignment, and that doesn't properly convert it to the YYYY-MM-DD
format that most databases (including ABS) expect. Properly using AsDateTime
allows the database driver/component to convert to the specific date format the DBMS uses.
Also, is your database field really named DATE
? Date is usually a reserved word or function name in most DBMS, and if it is it usually needs to be quoted.