首页 > 技术文章 > sql 查询一段时间内某个时间点数据

ghelement 2015-11-09 11:37 原文

 SELECT  CONVERT(VARCHAR(10), dtCreateTime, 120) AS dtStatisticsCreateDate, COUNT(1) AS nStatisticsCount
                    FROM    Web_Statistics
                    WHERE datepart(hh,dtCreateTime)>=10 AND datepart(hh,dtCreateTime)<11 AND dtCreateTime>'2015-01-01' AND dtCreateTime<'2015-01-03'

推荐阅读