ADODataSet(dst) dst.active :=false; dst.commandtext:=' select * ,iif(state=1,"录入未完成",iif(state=2,"录入完成",iif(state=3,"校对通过",iif(state=4,"校对未通过",iif(state=5,"审核通过","审核未通过"))))) as stat from tablename'; dst.active :=true;显示的对应结果将是,1--》录入未完成,2--》录入完成,3--》校对通过,4--》校对未通过,5--》审核通过,6--》审核未通过。
IIf(state=1, "s1", "s2") state=1成立则返回s1,不成立则返回s2.
设计期间,在adodataset上点击右键,在弹出的窗口中点击右键,然后选择add all fields菜单,加入字段后,点击你那个字段,在onGetText事件中写代码: case Sender.asinteger of 1: Text:='...'; 2: Text:='...'; 3: Text:='...'; end; displayText:=true; 更详细的信息看delphi帮助
dst.active :=false;
dst.commandtext:=' select * ,iif(state=1,"录入未完成",iif(state=2,"录入完成",iif(state=3,"校对通过",iif(state=4,"校对未通过",iif(state=5,"审核通过","审核未通过"))))) as stat from tablename';
dst.active :=true;显示的对应结果将是,1--》录入未完成,2--》录入完成,3--》校对通过,4--》校对未通过,5--》审核通过,6--》审核未通过。
state=1成立则返回s1,不成立则返回s2.
case Sender.asinteger of
1: Text:='...';
2: Text:='...';
3: Text:='...';
end;
displayText:=true;
更详细的信息看delphi帮助