CSDN首页 空间 新闻 论坛 Blog 下载 读书 网摘 搜索 .NET Java 视频 接项目 求职 在线学习 买书 程序员 通知
不看会后悔的Windows XP之经验谈 简单快捷DIY实用家庭影院
CSDN社区
搜索 收藏 打印 关闭
CSDN社区 >  VB >  基础类

[在线等待]请大家看一条SQL语句,急.....

楼主dingzhihui(无名)2006-06-01 08:46:58 在 VB / 基础类 提问

select   *   from   xxx   where   Name='   "   &   text1.text   &   "   '   and   Date1   Between   '   #   "   &   vba.format(BeginDate.value,"yyyy-mm-dd")   &   "   #   '   and   '   #   "   &   vba.format(EndDate.value,"yyyy-mm-dd)   &   "   #   '   order   by   id    
  请大家看看有没有问题,在我机子上运行没有问题,但就是查不出东西来... 问题点数:20、回复次数:5Top

1 楼vbman2003(家人)回复于 2006-06-01 08:56:53 得分 5

字段name是数据库保留字,你用[]括起来试试:  
  "select   *   from   tb   where   [name]='"   &   trim(text1.text)   &   "'"......Top

2 楼dingzhihui(无名)回复于 2006-06-01 08:59:08 得分 0

请各位帮忙,自己先顶Top

3 楼dingzhihui(无名)回复于 2006-06-01 09:01:30 得分 0

不行的name这里没有问题,主要是后面的日期的比较有问题。Top

4 楼Leftie(左手,为人民币服务)回复于 2006-06-01 09:09:35 得分 15

数据库为ACCESS:  
  select   *   from   xxx   where   [Name]='"   &   text1.text   &   "'   and   Date1   Between     #   "   &   vba.format(BeginDate.value,"yyyy-mm-dd")   &   "   #     and     #   "   &   vba.format(EndDate.value,"yyyy-mm-dd)   &   "   #     order   by   id  
  数据库为SQL:  
  select   *   from   xxx   where   [Name]='"   &   text1.text   &   "'   and   Date1   Between   '"   &   vba.format(BeginDate.value,"yyyy-mm-dd")   &   "'   and   '"   &   vba.format(EndDate.value,"yyyy-mm-dd)   &   "'   order   by   idTop

5 楼dingzhihui(无名)回复于 2006-06-01 09:25:22 得分 0

谢楼上了,问题已解决。Top

相关问题

关键词

得分解答快速导航

  • 帖主:dingzhihui
  • vbman2003
  • Leftie

相关链接

  • Visual Basic类图书
  • Visual Basic类源码下载

广告也精彩

反馈

请通过下述方式给我们反馈
反馈
提问
网站简介|广告服务|VIP资费标准|银行汇款帐号|网站地图|帮助|联系方式|诚聘英才|English|问题报告
北京创新乐知广告有限公司 版权所有, 京 ICP 证 070598 号
世纪乐知(北京)网络技术有限公司 提供技术支持
Copyright © 2000-2008, CSDN.NET, All Rights Reserved
GongshangLogo