L
liuyang
Unregistered / Unconfirmed
GUEST, unregistred user!
for i:=1 to query1.RecordCount do
begin
result:=true;
for j:=0 to dbcombobox37.Items.Count-1 do
if (dbcombobox37.Items[j]= copy(datetostr(query1.fieldbyname('tbrq').asdatetime),0,4)) and (datetostr(query1.fieldbyname('tbrq').asdatetime)<>'') then result:=false;
if result then dbcombobox37.Items.Add(copy(datetostr(query1.fieldbyname('tbrq').asdatetime),0,4));
query1.Next;
end;a
但原来的记录就比较混乱,在dbcombobox的效果可能是
1996
2000
1997
1992
现想把它排一下序。
1992
1996
1997
2000
我好象记得有个属性直接就可以,要不然就必须写一段代码?(给出代码的大虾多多给分)
begin
result:=true;
for j:=0 to dbcombobox37.Items.Count-1 do
if (dbcombobox37.Items[j]= copy(datetostr(query1.fieldbyname('tbrq').asdatetime),0,4)) and (datetostr(query1.fieldbyname('tbrq').asdatetime)<>'') then result:=false;
if result then dbcombobox37.Items.Add(copy(datetostr(query1.fieldbyname('tbrq').asdatetime),0,4));
query1.Next;
end;a
但原来的记录就比较混乱,在dbcombobox的效果可能是
1996
2000
1997
1992
现想把它排一下序。
1992
1996
1997
2000
我好象记得有个属性直接就可以,要不然就必须写一段代码?(给出代码的大虾多多给分)