# SQL Server DATEADD() Function | Novice Tutorial
# [Novice Tutorial -- Learning Technology, Pursuing Dreams!](
* (
* (
* (
* (
* (javascript:void(0);)
* (
* (
* (
* (
* [C++](
* [C#](
* (javascript:void(0);)
* (
* (
* (
* (
* (javascript:void(0);)
* (
* (
* (
* (
* (
* (
* (
* (javascript:void(0))
* (
* (
* (
* (
* (
* (
* (
* (
* (
* (
* (
* (
* (
SQL Tutorial
( "SQL Tutorial")( "SQL Introduction")( "SQL Syntax")( "SQL SELECT Statement")( "SQL SELECT DISTINCT Statement")( "SQL WHERE Clause")[SQL AND & OR]( "SQL AND & OR Operators")( "SQL ORDER BY Keyword")( "SQL INSERT INTO Statement")( "SQL UPDATE Statement")( "SQL DELETE Statement")
## SQL Advanced Tutorial
( "SQL SELECT TOP, LIMIT, ROWNUM")( "SQL LIKE Operator")( "SQL Wildcards")( "SQL IN Operator")( "SQL BETWEEN Operator")( "SQL Aliases")( "SQL JOIN")( "SQL INNER JOIN Keyword")( "SQL LEFT JOIN Keyword")( "SQL RIGHT JOIN Keyword")( "SQL FULL OUTER JOIN Keyword")( "SQL UNION Operator")( "SQL SELECT INTO Statement")( "SQL INSERT INTO SELECT Statement")( "SQL CREATE DATABASE Statement")( "SQL CREATE TABLE Statement")( "SQL Constraints")( "SQL NOT NULL Constraint")( "SQL UNIQUE Constraint")( "SQL PRIMARY KEY Constraint")( "SQL FOREIGN KEY Constraint")( "SQL CHECK Constraint")( "SQL DEFAULT Constraint")( "SQL CREATE INDEX Statement")( "SQL DROP Index, Table and Database")( "SQL ALTER TABLE Statement")( "SQL AUTO INCREMENT Field")( "SQL CREATE VIEW, REPLACE VIEW, DROP VIEW Statements")( "Date Functions in SQL Server and MySQL")( "SQL NULL Values β IS NULL and IS NOT NULL")( "SQL ISNULL(), NVL(), IFNULL() and COALESCE() Functions")( "SQL General Data Types")( "SQL MS Access, MySQL and SQL Server Data Types")
## SQL Functions
( "SQL Functions")[SQL AVG()]( "SQL AVG() Function")[SQL COUNT()]( "SQL COUNT() Function")[SQL FIRST()]( "SQL FIRST() Function")[SQL LAST()]( "SQL LAST() Function")[SQL MAX()]( "SQL MAX() Function")[SQL MIN()]( "SQL MIN() Function")[SQL SUM()]( "SQL SUM() Function")[SQL UCASE()]( "SQL UCASE() Function")[SQL LCASE()]( "SQL LCASE() Function")[SQL MID()]( "SQL MID() Function")[SQL LEN()]( "SQL LEN() Function")[SQL ROUND()]( "SQL ROUND() Function")[SQL NOW()]( "SQL NOW() Function")[SQL FORMAT()]( "SQL FORMAT() Function")
SQL Server DATEADD() Function
The DATEADD() function adds a time/date interval to a date and then returns the date.
DATEADD() Syntax
```sql
DATEADD(datepart, number, date)
```
Parameter Values
Parameter | Description
---|---
datepart | Required. Specifies on which part to add/subtract the number. The value can be one of the following:
| Value | Abbreviation |
|---|
| year | yy, yyyy |
| quarter | qq, q |
| month | mm, m |
| dayofyear | dy, y |
| day | dd, d |
| week | wk, ww |
| weekday | dw, w |
| hour | hh |
| minute | mi, n |
| second | ss, s |
| millisecond | ms |
| microsecond | us |
| nanosecond | ns |
number | Required. The value used for addition (if positive) or subtraction (if negative)
date | Required. The date to add to
DATEADD() Example
The following example adds 30 days to the current date:
```sql
SELECT DATEADD(day, 30, GETDATE()) AS DateAdd;
```
The following example adds 3 years to the current date:
```sql
SELECT DATEADD(year, 3, GETDATE()) AS DateAdd;
```
The following example subtracts 3 years from the current date:
```sql
SELECT DATEADD(year, -3, GETDATE()) AS DateAdd;
```
SQL Server Functions