sql代码如下:
--下面示例的语句返回 1:
SELECT datediff( hour,'4:00AM','5:50AM' )
--下面的语句返回 102:
SELECT datediff( month,'1987/05/02','1995/11/15' )
--下面的语句返回 0:
SELECT datediff( day,'00:00','23:59' )
--下面的语句返回 4:
SELECT datediff( day,'1999/07/19 00:00','1999/07/23 23:59' )
--下面的语句返回 0:
SELECT datediff( month,'1999/07/19','1999/07/23' )
--下面的语句返回 1:
SELECT datediff( month,'1999/08/23' )
---- 来自jb51.cc