数据窗口检索的问题??谢谢!
数据窗口需要达到的目的是:
先是根据条件检索出符合条件的纪录,然后根据条件对某列进行排序,
最后是显示前面的100行数据,我是这样实现的:
//传递待排序的列名
if rb_1.checked=true then
col_name="sumqty"
elseif rb_2.checked=true then
col_name="saleamount"
elseif rb_3.checked=true then
col_name="subprice"
elseif rb_4.checked=true then
col_name="subrate"
end if
string ll_sort
if rb_5.checked=true then
ll_sort=" D"//降序排列
elseif rb_6.checked=true then
ll_sort=" A"//升序排列
end if
long count
select count(*)
into :count
from u_sale_top;
if count<=0 then
MessageBox("提示","查询前必须进行统计!",information!,ok!,1)
else
dw_2.settransobject(sqlca)
dw_2.retrieve()
dw_2.setsort(col_name+ll_sort)
dw_2.sort()
//去掉100以后的行
int i
if dw_2.rowcount()>100 then
for i=100 to dw_2.rowcount()
dw_2.deleterow(i)
next
end if
end if
结果不行----不符合要求!
请问错在哪儿?