例1,
> select dateadd(day, 1, '2002-09-30 11:35:00')
> GO
-----------------------
2002-10-01 11:35:00.000
(1 rows affected)
例2,
> select DATEADD(month, 1, '2002-09-30 11:35:00')
> GO
-----------------------
2002-10-30 11:35:00.000
(1 rows affected)
例3,
> select DATEADD(year, 1, '2002-09-30 11:35:00')
> GO
-----------------------
2003-09-30 11:35:00.000
(1 rows affected)
例4,
> select DATEADD(hour, 1, '2002-09-30 11:35:00')
> GO
-----------------------
2002-09-30 12:35:00.000
(1 rows affected)
例5,
> select DATEADD(minute, 1, '2002-09-30 11:35:00')
> GO
-----------------------
2002-09-30 11:36:00.000
(1 rows affected)
例6,
> select DATEADD(second, 1, '2002-09-30 11:35:00')
> GO
-----------------------
2002-09-30 11:35:01.000
(1 rows affected)