DECLARE @begin_date DATETIME,@end_date DATETIME; SELECT @begin_date = CONVERT(DATETIME,CONVERT(CHAR(10), DATEADD(DAY,-2,GETDATE()),120) + ' 00:00:00',120); SELECT @end_date = CONVERT(DATETIME,CONVERT(CHAR(10), GETDATE(),120) + ' 23:59:59',120); SELECT @begin_date AS 开始时间,@end_date AS 结束时间;