对查询结果中的某个空字段附值?
查询排序代码:
begin
rep_infor.resultQuery.Close;
rep_infor.resultQuery.SQL.Clear;
if (resultcombobox3.Text=floattostr(3)) then
rep_infor.resultQuery.SQL.Add('select top 3 号码,姓名,性别,单位,项目名称,成绩,得分 from perinfor_input')
else
if (resultcombobox3.Text=floattostr(4)) then
rep_infor.resultQuery.SQL.Add('select top 4 号码,姓名,性别,单位,项目名称,成绩,得分 from perinfor_input ')
else
if (resultcombobox3.Text=floattostr(5)) then
rep_infor.resultQuery.SQL.Add('select top 5 号码,姓名,性别,单位,项目名称,成绩,得分 from perinfor_input')
else
if (resultcombobox3.Text=floattostr(6)) then
rep_infor.resultQuery.SQL.Add('select top 6 号码,姓名,性别,单位,项目名称,成绩,得分 from perinfor_input');
rep_infor.resultQuery.SQL.Add('where 项目名称=:items and 性别=:sex order by 成绩 desc');
rep_infor.resultQuery.Parameters.ParamByName('items').Value:=sj;
rep_infor.resultQuery.Parameters.ParamByName('sex').Value:=xb;
rep_infor.resultQuery.Open;
end;
end;
rep_infor.resultQuery.First;
rep_infor.resultQuery.Edit;
下面开始对排出的顺序中的‘得分’字段添加数值。//错误之处?请指点
目的是为了按顺序不同给不同的分值,将排序的所有记录都附值。
begin
while not rep_infor.resultQuery.Eof do
begin
inc(row);
if row=1 then
rep_infor.resultQuery.FieldByName('得分').AsInteger:=7;
if row=2 then
rep_infor.resultQuery.FieldByName('得分').AsInteger:=5;
if row=3 then
rep_infor.resultQuery.FieldByName('得分').AsInteger:=4;
if row=4 then
rep_infor.resultQuery.FieldByName('得分').AsInteger:=3;
if row=5 then
rep_infor.resultQuery.FieldByName('得分').AsInteger:=2;
if row=6 then
rep_infor.resultQuery.FieldByName('得分').AsInteger:=1;
end;
rep_infor.resultQuery.Post;
rep_infor.resultQuery.Next;
end;
begin
rep_infor.resultQuery.Close;
rep_infor.resultQuery.SQL.Clear;
if (resultcombobox3.Text=floattostr(3)) then
rep_infor.resultQuery.SQL.Add('select top 3 号码,姓名,性别,单位,项目名称,成绩,得分 from perinfor_input')
else
if (resultcombobox3.Text=floattostr(4)) then
rep_infor.resultQuery.SQL.Add('select top 4 号码,姓名,性别,单位,项目名称,成绩,得分 from perinfor_input ')
else
if (resultcombobox3.Text=floattostr(5)) then
rep_infor.resultQuery.SQL.Add('select top 5 号码,姓名,性别,单位,项目名称,成绩,得分 from perinfor_input')
else
if (resultcombobox3.Text=floattostr(6)) then
rep_infor.resultQuery.SQL.Add('select top 6 号码,姓名,性别,单位,项目名称,成绩,得分 from perinfor_input');
rep_infor.resultQuery.SQL.Add('where 项目名称=:items and 性别=:sex order by 成绩 desc');
rep_infor.resultQuery.Parameters.ParamByName('items').Value:=sj;
rep_infor.resultQuery.Parameters.ParamByName('sex').Value:=xb;
rep_infor.resultQuery.Open;
end;
end;
rep_infor.resultQuery.First;
rep_infor.resultQuery.Edit;
下面开始对排出的顺序中的‘得分’字段添加数值。//错误之处?请指点
目的是为了按顺序不同给不同的分值,将排序的所有记录都附值。
begin
while not rep_infor.resultQuery.Eof do
begin
inc(row);
if row=1 then
rep_infor.resultQuery.FieldByName('得分').AsInteger:=7;
if row=2 then
rep_infor.resultQuery.FieldByName('得分').AsInteger:=5;
if row=3 then
rep_infor.resultQuery.FieldByName('得分').AsInteger:=4;
if row=4 then
rep_infor.resultQuery.FieldByName('得分').AsInteger:=3;
if row=5 then
rep_infor.resultQuery.FieldByName('得分').AsInteger:=2;
if row=6 then
rep_infor.resultQuery.FieldByName('得分').AsInteger:=1;
end;
rep_infor.resultQuery.Post;
rep_infor.resultQuery.Next;
end;
...全文
相关推荐
绘制(平滑与折线)曲线
绘制(平滑与折线)曲线。 数据直观,界面漂亮。
基于canvas使用贝塞尔曲线平滑拟合折线段的方法
主要介绍了基于canvas使用贝塞尔曲线平滑拟合折线段的方法的相关资料,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧
Qt 鼠标/触屏绘制平滑曲线(支持矢量/非矢量方式)
主要介绍了Qt 鼠标/触屏绘制平滑曲线(支持矢量/非矢量方式),文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
绘制折线图
适合初学者,一个很好的绘制折线,主要利用大家不常用的DrawCurve()函数
2D折线顶点平滑
通过插值(Catmull-Rom)或逼近(Chaikin)平滑2D折线


