- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
with dm.Query do
begin
if Active then Close;
//вот так оно работало до ввода параметров
//dm.QStat.SQL.Text := 'select * from T_ORDER where (date between ''' + IntToStr(ys) + '-' + IntToStr(ms) + '-' + IntToStr(ds) + ''' and ''' + IntToStr(yf) + '-' + IntToStr(mf) + '-' + IntToStr(df) + ''')' ;
SQL.Text := 'select * from T_ORDER where (date between :StartDate and :FinishDate)';
Parameters.ParamByName('StartDate').Value := IntToStr(ys) + '-' + IntToStr(ms) + '-' + IntToStr(ds);
Parameters.ParamByName('FinishDate').Value := IntToStr(yf) + '-' + IntToStr(mf) + '-' + IntToStr(df);