sql日期查询的问题。
数据表notes
字段日期,类型smalldatetime。
我在做asp.net程序时用了一下语句。
select id from notes where 日期='2005-1-25'
在查询分析器里可以运行。
但是asp.net程序老是报错,说标准表达式中数据类型不匹配。
请高手赐教。
谢谢。
问题点数:30、回复次数:4Top
1 楼phantomMan()回复于 2005-07-26 17:20:57 得分 5
convert(char(10),'2005-1-25',120)Top
2 楼skywebnet(小苯)回复于 2005-07-26 17:26:33 得分 15
select id from notes where datediff(day , 日期, '2005-1-25')=0Top
3 楼wyb0026(小小)回复于 2005-07-26 17:30:20 得分 0
.net 脚本有问题可能传入参数的类型不对Top
4 楼aw511(点点星灯)回复于 2005-07-26 18:14:49 得分 10
--选择日期在2004-09-03的数据
select top * from tgoods where datediff(Day,dpubl,'2004-09-03')=0Top




