模糊查询查不出结果

tcchong 2004-10-11 02:03:17
string ls_c_sql,ls_str

ls_str = trim(sle_1.text)
ls_c_sql = 'select * from talbe1 where id8 = ' + "'" + ls_c_date + "' " + ' and id3 like ' + "' %" + ls_str + "%' "
dw_1.setsqlselect(ls_c_sql)
dw_1.retrieve()

table1中有满足条件的数据,怎么就是查不出来呢,ls_c_sql我用messagebox显示出来没有错啊,我在
db administration直接查询是有数据的,另外,去掉+ ' and id3 like ' + "' %" + ls_str + "%' "
事没问题的。
...全文
98 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
xuam 2004-10-11
  • 打赏
  • 举报
回复
表达式错误!
去掉一个""
klbt 2004-10-11
  • 打赏
  • 举报
回复
ls_c_sql = 'select * from talbe1 where id8 = ' + "'" + ls_c_date + "' " + ' and id3 like ' + "' %" + ls_str + "%' "修改为:
ls_c_sql = 'select * from talbe1 where id8 = ' + "'" + ls_c_date + "' " + ' and id3 like ' + "'%" + ls_str + "%' "
你多写了一个空格。

1,075

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder 相关问题讨论
社区管理员
  • 基础类社区
  • WorldMobile
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧