commstr="select * from psversion where 开始日期<='#2004-07-01#'";commstr="select * from psversion where 开始日期<='"+ Convert.ToDateTime('2004-07-01').date+"'";commstr="select * from psversion where 开始日期<='2004-07-01'";commstr="select * from psversion where 开始日期<='#2004-07-01 12:00:00'";都试过了, 不行呀!
解决方案 »
- 关于repeater控件动态创建的按钮,不能触发ItemCommand的问题
- asp传值的问题
- linkbutton下实现application
- 上传到远程服务器10秒左右Session丢失了!
- 关于检验控件的一个问题
- 字符串变量值为“false”怎样同字符串“false”比较呢?
- 这是一datagrid点击datagrid中的数据一下就可以更新,2下就可以保存的代码,我搞不懂为什么我的总是保存不了,请高手指点
- 新上的服务器 老是提示.tmp文件不是有效 WIN32 资源文件 求救
- 多行查询显示问题
- 以下代码错在什么地方
- 关于System.Drawing命名空间的问题?
- 如何判断局域网上一个共享文件夹内的文件存在?
如果我把SQL语句改为: Sselect * from psversion 就可以查询出所有的数据了, 现在关键就是怎么去比较日期, 请大家帮忙! 谢谢大家了.
commstr="select * from psversion where 开始日期<="+ Convert.ToDateTime("2004-07-01");
这样试一下。或者你这样调试一下,将这条生成的SQL语句放到数据库中运行一下,这样错误比较清楚.
commstr="select * from psversion where 开始日期 < 2004-7-1 ";但是问题来了:我新建了一个access表[date],里面又两个字段begin和end,分别为2000-1-1,2000-3-1。我用"select * from [date] where begin < 2004-7-1 "查不到,用"select * from [date] where begin > 2004-7-1 "反而查到了,怪了!!!!
大家不信可以试试看。
这样不行呀! 查不出什么结果来, 查询的东西为空, 我的DatagriD为空值,
"select * from [date] where begin < 2004-7-1 "查不到,用"select * from [date] where begin > 2004-7-1 "反而能查到。
你把commstr="select * from psversion where 开始日期 < 2004-7-1 ";改成commstr="select * from psversion where 开始日期 > 2004-7-1 ";试试
commstr="select * from psversion where 开始日期 >#2004-7-1#",
但是我试了试, 不行呀!
commstr="select * from psversion where 开始日期 >#2004-7-1#";
呵呵!散分了!......