大家帮忙看一下这个select语句是什么错误?

zds835 2005-07-12 03:26:37
这个select语句,有语法错误。各位帮忙改一下:
int zds=+5;
HttpCookie cookie = Request.Cookies["aspqx"]
OdbcCommand cmd=new OdbcCommand("select zhdh,name from dk3 where dqrq between ? and ? and bm=(select distinct bm from qzjdb:login where qx= ?) ",this.conn);
cmd.Parameters.Add("@qx",OdbcType.VarChar, 10);
cmd.Parameters["@qx"].Value=cookie.Value;
cmd.Parameters.Add("@datefrom",OdbcType.VarChar, 10);
cmd.Parameters["@datefrom"].Value=DateTime.Now.ToShortDateString();
cmd.Parameters.Add("@dateto",OdbcType.VarChar, 10);
cmd.Parameters["@dateto"].Value=DateTime.Now.AddDays(+zds).ToShortDateString();
...全文
96 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
builderman 2005-07-12
  • 打赏
  • 举报
回复
bm=(select distinct bm from qzjdb:login where

RE: bm in(select distinct bm from qzjdb:login where
zds835 2005-07-12
  • 打赏
  • 举报
回复
自己解决了。谢谢大家!!!!
zhy16 2005-07-12
  • 打赏
  • 举报
回复
select zhdh,name from dk3 where dqrq between (? and ?) and bm=(select distinct bm from qzjdb:login where qx= ?)
试一下看成不成?
zhy16 2005-07-12
  • 打赏
  • 举报
回复
up
sfanpu 2005-07-12
  • 打赏
  • 举报
回复
错误提示呢?
egonzou 2005-07-12
  • 打赏
  • 举报
回复
OdbcCommand cmd=new OdbcCommand("select zhdh,name from dk3 where (dqrq between ? and ? )and bm=(select distinct bm from qzjdb:login where qx= ?) ",this.conn);

这样试试看行不行
真相重于对错 2005-07-12
  • 打赏
  • 举报
回复
between ?//what is this
and ?//what is this
and bm=(select distinct bm from qzjdb:login where qx= ?//what is this
) ",this.conn);
qinjin2000 2005-07-12
  • 打赏
  • 举报
回复
关注中
眼睛都看花了

110,533

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

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