with adoquery1 do begin close; sql.Clear; sql.Add('select * from table where "'+combobox1.text+'">:a and "'+combobox1.text+'"=:b'); parameters.ParamByName('a').Value:=datetimetostr(datetimepicker1.date); parameters.ParamByName('b').Value:=datetimetostr(datetimepicker2.Date); open; end;我也遇到这问题了 ,查询不出来数据,,哪里有问题。。??
var i : integer; begin i:=ComboBox1.Items.IndexOf(Trim(ComboBox1.Text)); //显示你所选的行号 Showmessage(inttostr(i)); end;
Combobox.ItemIndex = 0 是第一行,类推
返回-1:表示沒有 0:第1行 1:第2行...
begin
close;
sql.Clear;
sql.Add('select * from table where "'+combobox1.text+'">:a and "'+combobox1.text+'"=:b');
parameters.ParamByName('a').Value:=datetimetostr(datetimepicker1.date);
parameters.ParamByName('b').Value:=datetimetostr(datetimepicker2.Date);
open;
end;我也遇到这问题了 ,查询不出来数据,,哪里有问题。。??
i : integer;
begin
i:=ComboBox1.Items.IndexOf(Trim(ComboBox1.Text));
//显示你所选的行号
Showmessage(inttostr(i));
end;