在做查询时,pro_date是datatime类型,我输入记录2005-02-04
但pro_date为2005-02-04 00:00:00.000
而不是2005-02-04
我的sql语句是这样写的select *from productInfo where pro_date between 2005-02-04 00:00:00.000 and 2005-02-12 00:00:00.000这样调试错误.
但写成select * from productInfo where pro_date between 2005-02-04 and 2005-02-12有查询不出记录,
能不能在表中直接把2005-02-04 00:00:00.000转化成2005-02-04
问题怎么解决?
但pro_date为2005-02-04 00:00:00.000
而不是2005-02-04
我的sql语句是这样写的select *from productInfo where pro_date between 2005-02-04 00:00:00.000 and 2005-02-12 00:00:00.000这样调试错误.
但写成select * from productInfo where pro_date between 2005-02-04 and 2005-02-12有查询不出记录,
能不能在表中直接把2005-02-04 00:00:00.000转化成2005-02-04
问题怎么解决?
解决方案 »
- 小问题,List<>做形式参数为什么会改变内容
- 请问:用CryptAPI加密,用StreamWriter写后,空的txt文档为什么会有3个字节长度?
- 求WebRequest 被禁止的解决方案
- 调用c++ DLL 返回结构体问题
- C#中DataGrid的使用问题
- [高分求助]请问,在C#中怎样才能将取出DLL链接库中定义的函数数据?:
- 怎样在DataGrid行的编辑状态下读取数据库里的表并加载到菜单,并实现菜单选中项的判别?????????????
- 小弟是个新手,有问题请教!
- 在WinForm下的DataGrid的表头能否显示成多行的?
- 紧急求助!!程序在用户计算机上安装完后,启动出错.快帮帮忙.
- 动态生成水晶报表。。(高分,在线等)
- 关于ASP.NET的一个问题请教(关于类的引用)
select * from productInfo where to_date(pro_date) between to_date(2005-02-04) and to_date(2005-02-12)或者
sql
select * from productInfo where pro_date between '2005-02-04' and '2005-02-12'
在属性里有一个format属性,选择custom
在行为里有个customformat,输入yyyy-MM-dd
select * from productInfo where pro_date between # 2005-02-04 # and # 2005-02-12 #日期查詢的格式如下書寫:
......where BETWEEN # "+dateTimePicker1.Text +"# AND #"+dateTimePicker2.Text+"#";