'select * from '''+MReportForm.ARTable+''' where DepName in ('''+SDep+''') order by..... '
解决方案 »
- 动态数组的数组名的判断,怎么做?
- delphi调用excel后主程序仍在运行如何关闭excel?(在线等待)
- FTP协议断点续传 思路讨论,高手请进
- FasterReport挑食?
- 有没有谁在线啊?qq上帮帮忙好不好?
- 怎么实现控制面板当中的添加windows组件功能!!!是哪个api函数
- 用winexec()执行一个exe文件后,怎么判断exe已经执行完毕?
- 这样的异常错误,怎么捕获? 怎样显示出它的错误码? 详见内容。 谢谢
- 有没有比random更好的随机函数啊?
- 继续请教各位前辈:如何将datacontrols中的控件与database相连?
- 在关闭我程序时候总提示:内存不能读,很讨厌,能不能用try给过滤了?
- 怎样把bmp等格式图片当成cursor来用?
select * from YourTable where DepName in ('AB','BC','CC','DD') order by DepName
functuion(step:string):Newstep;
var
len,len1,len2,i,j:integer;
temp1,temp2:string;
begin
len:=length(step);
len2:=0;
temp2:=step;
for i:=0 to len-1 do
begin
len1:=pos(step,',');
if len1>0 then
begin
temp1:=copy(step,len2+1,len1-1);
step:=copy(step,len1+1,len-1);
if length(result) >0 then
result:= result+','+quoted(temp1);
else result := qutoted(temp1);
end;
end;
end;
然后你就可以向你那样写了
SQL.Add('select * from '+MReportForm.ARTable+' where DepName in ('''+SDep+''') order by DepName');