日期:2014-05-17  浏览次数:20756 次

同一条sql在查询分析器有数据,在asp中执行却返回不了记录集。
同一个sql查询语句,在查询分析器里面查询到记录,可是写到asp里却查询不到记录,大家知道这是什么问题吗?
sql   用意:查询07年4月1日早上8:40到晚上8:40之间的数据。
sql=select   distinct   *   FROM   WorkAttendanceAll   where   replace(replace(replace(CONVERT(varchar,   time,   120   ), '- ', ' '), '   ', ' '), ': ', ' ')   between   '070401084000 '   and   '070401204000 '   order   by   time

------解决方案--------------------
sql=select distinct * FROM WorkAttendanceAll where [time] between '2007-4-1 8:40:00 ' and '2007-4-1 20:40:00 ' order by [time]