读书人

怎么在一个字符串中插入字符串?

发布时间: 2012-01-14 20:02:35 作者: rapoo

如何在一个字符串中插入字符串???
Select strNo,strName From aa Where group by strNo
把strDate=2007-03-01 '插入Where 后面怎么实现???

[解决办法]
s = "Select strNo,strName From aa Where group by strNo "
s = replace(s, "Where ", "Where strDate= '2007-03-01 ' ")

[解决办法]
s = "Select strNo,strName From aa Where strNo= '01 ' group by strNo "
s = replace(s, " group by ", "strDate= '2007-03-01 ' group by ")

[解决办法]
dim strsql as string
strsql= "Select strNo,strName From aa where 1=1 "
if strDate <> " " then
strsql=strsql& " and strDate= '2007-03-01 ' "
end if
strsql=strsql& " group by strNo "

读书人网 >VB

热点推荐