首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VB >

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

2012-01-14 
如何在一个字符串中插入字符串???SelectstrNo,strNameFromaaWheregroupbystrNo把strDate2007-03-01 插入W

如何在一个字符串中插入字符串???
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 "

热点排行