'select * from '''+MReportForm.ARTable+''' where DepName in ('''+SDep+''') order by..... '
解决方案 »
- cxgrid如何添加一行值。
- quickrpt打印父子结构表时,如何每一页的开头都打印父数据?
- vc的函数声明如何转换到delphi,急求大虾帮忙
- $IFDEF DEBUGMSG是什么意思?
- Access数据库的问题,请高手帮忙!!!
- delphi菜鸟一个问题.着急急急急急急急急急急急急急急急急急急急急急急急急
- 急急急!一个关于查询速度的问题(给分100)
- delphi高手在那里?
- 在DBGRID中有多个字段,如何在向右滚动时保持前几个字段不动?
- 如何在DELPHI中实现把自己的程序加入IE的工具栏???
- 在关闭我程序时候总提示:内存不能读,很讨厌,能不能用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');