易截截图软件、单文件、免安装、纯绿色、仅160KB

sql语句出错

sql="select * from mastermail  where time > "&starttime&" and time < "&endtime&"  order by id desc "
数据库中有数据,却显示不出来
还得跟日期关联才能选出正确的结果吧

如果time是文本字段
VBScript code:

sql="select * from [mastermail] where( [time] > '"&starttime&"' and time < '"&endtime&"') order by [id] desc "




数据库中日期 与传递过来的日期 都 是 2009-10-22 这种格式的,所以不存在日期格式不同问题,但为什么不显示呢

time 为时间类型

高手赐教啊

是不是日期和字符串比较 你要把类型转换一下啊

都是日期类型的

between and  不是很好吗 ?

我开始用的就是 between and  结果是一样的

VBScript code:
sql="select * from [mastermail] where [time] >= '" & starttime & " 00:00:00' and time <= '" & endtime & "23:59:59' order by [id] desc "




access sql 数据库的日期比较时不一样的
access:
sql="select * from mastermail  where time > #"&starttime&"# and time < #"&endtime&"#  order by id desc &qu


相关问答:

总会碰到怪的问题,sql问题

sql2005
select *from v_ddxx where d_sfsc='0' and (g_ssbm='1001' or g_ssbm='1002') and (xxf>0 and  xxfwzf <>0 ),执行速度慢的要死,但是如果把(xxf>0 and  ......

access 中执行sql语句update不成功,求助!!!

access 中执行sql update语句时有时候成功有时候不成功,但是access中不出错误信息,不知道是什么原因,有哪位大侠知道,请帮忙啊
贴SQL语句,检查表、字段的有效性设置

sql 在查询分析器里面 执行很正常

是 ......

dbf表导入到sql server2000表问题

请问:
1,如何将一张dbf表导入到sql server2000中的一张表。使用DTS该怎样实现?
2,使用网上代码:
Insert Into Tb_cj Select * from openrowset('MSDASQL','Driver=Microsoft Visual FoxPro D ......

求一SQL - MS-SQL Server / 基础类

表如下
教室ID 座位数 开始时间 结束时间 2009年1月1日 2009年1月2日 2009年1月3日
  101 50 08:00 08:30 30 40 50  
  101 50 09:00 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号