摘要:
--获取当天时间段值 SELECT DATEADD(MS,0,DATEADD(DD, DATEDIFF(DD,0,GETDATE()), 0)) SELECT DATEADD(MS,-3,DATEADD(DD, DATEDIFF(DD,-1,GETDATE()), 0))--获取本周时间段值 SELECT DATEADD(WK,DATEDIFF(WK,0,GETDATE()),-1)SELECT DATEADD(WK,DATEDIFF(WK,0,GETDATE()),6)--获取本月时间段值SELECT DATEADD(MM,DATEDIFF(MM,0,GETDATE()),0)SELECT 阅读全文