作者cloudsan (趴千)
看板Database
标题Re: [SQL ] 时间查询问题
时间Tue Apr 30 19:00:28 2013
Where calltime between '2012-10-01' and '2012-10-31'
and (datepart(hh,calltime)<8) and (datepart(hh,calltime)>=6)
这样可以查出2012 10 月每天6点到8点(不含8点)的范围
不知道是不是你要的
※ 引述《bear1005 (πBear)》之铭言:
: 请问我现在是整月份的资料,时间资料如下
: 2012-10-01 16:51:56
: 但我想要找出每天的6~8点
: where [时间] BETWEEN '2012-10-06 06:00:00' AND '2012-10-06 23:59:59'
: 但是这样只能查询单天,除非我输入30天的OR指令,
: 另外我想请问两个时间栏位可以算出时间差吗?
: 该如何写语法?
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 61.228.10.6