日期:2014-05-17 浏览次数:20572 次
SELECT CONVERT(VARCHAR(30),CONVERT(DATE,'2013-05-23 14:21:32'))+' '+SUBSTRING(CONVERT(VARCHAR(20),CONVERT(TIME,'2013-05-23 14:21:32')),1,2)+':00:00'
SELECT CONVERT(VARCHAR(30),CONVERT(DATE,'2013-05-23 14:21:32'))+' '+SUBSTRING(CONVERT(VARCHAR(20),DATEADD(hour,1,CONVERT(TIME,'2013-05-23 14:21:32'))),1,2)+':00:00'
/*
-----------------------------------------
2013-05-23 14:00:00
(1 行受影响)
-----------------------------------------
2013-05-23 15:00:00
*/