|
Sjfrom := DateUtils.StartOfTheDay(DateTimePicker1.date);
Sjto := DateUtils.StartOfTheDay(DateTimePicker1.date+1);
strsjfrom := sysutils.FormatDateTime('yyyy-mm-dd hh:mm:ss',Sjfrom);
strsjto := sysutils.FormatDateTime('yyyy-mm-dd hh:mm:ss',Sjto);
//判断下拉框中值从而进行过滤
strtype :=ComboBox1.Text.Trim ;
if strtype='申请中' then
begin
DataSetBroker3.DataSet.Close;
with TSQLDataSet(DataSetBroker3.DataSet) do
begin
SQL.Text :='SELECT HYB.HYMC, HYB.FZR, HYB.YJKSSJ, HYB.YJJSSJ, HYB.SQR, HYB.SQHYSMC FROM HYB WHERE HYB.YJKSSJ >= to_date('''+ strsjfrom+''',''yyyy-MM-dd HH24:mi:ss'')' +'and HYB.YJKSSJ < to_date('''+ strsjto+''',''yyyy-MM-dd HH24:mi:ss'')';
jsDialogs.ShowMsg(SQL.Text, '系统提示');
end;
DataSetBroker3.DataSet.Open;
DataGrid2.DataSource.DataSet :=DataSetBroker3.DataSet ;
DataGrid2.ApplyBestFit(nil);
end
else
begin
DataSetBroker4.DataSet.Close;
with TSQLDataSet(DataSetBroker4.DataSet) do
begin
SQL.Text :='SELECT HYB.HYMC, HYB.FZR, HYB.ZRYJKSSJ, HYB.ZRYJJSSJ, HYB.SHHYSMC FROM HYB WHERE HYB.ZRYJKSSJ >= to_date('''+ strsjfrom+''',''yyyy-MM-dd HH24:mi:ss'')' +'and HYB.ZRYJKSSJ < to_date('''+ strsjto+''',''yyyy-MM-dd HH24:mi:ss'')';
end;
DataSetBroker4.DataSet.Open;
DataGrid2.DataSource.DataSet :=DataSetBroker4.DataSet ;
DataGrid2.ApplyBestFit(nil);
end; |
|