我在程序中要直接取本机的时间跟数据库中表中某条记录中的时间做比较,请问如何取这个本机时间,
我用的SQL语句如下:
select c.id,c.name
from sheet_items s left join custom c on
s.custom=c.id
where s.room='001'
and s.start_time<"now"
and s.end_time>"now"提示错误为:Syntax error converting datetime from character string.
我用的SQL语句如下:
select c.id,c.name
from sheet_items s left join custom c on
s.custom=c.id
where s.room='001'
and s.start_time<"now"
and s.end_time>"now"提示错误为:Syntax error converting datetime from character string.
解决方案 »
- 请教:IdTCPClient通讯过程中,iohandler改变问题
- 关于QQ连连看外挂的一点问题。。。请教达人。。。。
- 使用什么方法进行查询、计算、分类汇总最好呢?
- 微软 2004-11-13 笔试题解析
- 谁能帮我想一下!!可以加分!!
- 关于传口通讯的问题
- tapi的问题,非常紧急!
- 有关进度条的问题!!!
- !!!!!上午本来想散分的,散了200,不知道为什么可用分减了,帖子却不见,不知是什么原因?
- sos!!!!!!!!!
- 有关操作符"and"的使用,请高手指点!
- STR:='123456Qwe789';S1='Qwe', S2='ASDFG';如何 用'ASDFG' 代替 'Qer',使 Str:='123456ASDFG789';?
and s.start_time<:aa
and s.end_time>:bb
parameters.parambyanme(‘aa’).value:=datatime(now)
from sheet_items s left join custom c on
s.custom=c.id
where s.room='001'
and s.start_time<now()
-----
and s.end_time>now()
-----
now()是取得当前时间的函数,DATE()是取得当前日期的函数,是SQL中的函数,ACCESS与SQL SERVER可用
另外,我上面有个错误,就是在SQL SERVER中获取当前日期及时间的函数应该是GetDate()。