--- title: "+ (Addition) (Transact-SQL) | Microsoft Docs" ms.custom: "" ms.date: "03/16/2017" ms.prod: sql ms.prod_service: "database-engine, sql-database, sql-data-warehouse, pdw" ms.reviewer: "" ms.suite: "sql" ms.technology: t-sql ms.tgt_pltfrm: "" ms.topic: "language-reference" f1_keywords: - "add" - "+" - "+_TSQL" - "+ (Add)" dev_langs: - "TSQL" helpviewer_keywords: - "addition (+)" - "adding numbers" - "+ (add)" - "plus sign (+)" - "add operator (+)" ms.assetid: 4ba8baac-5f07-432c-87c5-d23e7011da55 caps.latest.revision: 39 author: "douglaslMS" ms.author: "douglasl" manager: craigg monikerRange: ">=aps-pdw-2016||=azuresqldb-current||=azure-sqldw-latest||>=sql-server-2016||=sqlallproducts-allversions||>=sql-server-linux-2017" --- # + (Addition) (Transact-SQL) [!INCLUDE[tsql-appliesto-ss2008-all_md](../../includes/tsql-appliesto-ss2008-all-md.md)] Adds two numbers. This addition arithmetic operator can also add a number, in days, to a date. ![Topic link icon](../../database-engine/configure-windows/media/topic-link.gif "Topic link icon") [Transact-SQL Syntax Conventions](../../t-sql/language-elements/transact-sql-syntax-conventions-transact-sql.md) ## Syntax ``` expression + expression ``` ## Arguments *expression* Is any valid [expression](../../t-sql/language-elements/expressions-transact-sql.md) of any one of the data types in the numeric category except the **bit** data type. Cannot be used with **date**, **time**, **datetime2**, or **datetimeoffset** data types. ## Result Types Returns the data type of the argument with the higher precedence. For more information, see [Data Type Precedence (Transact-SQL)](../../t-sql/data-types/data-type-precedence-transact-sql.md). ## Examples ### A. Using the addition operator to calculate the total number of hours away from work for each employee. This example finds the total number of hours away from work for each employee by adding the number of hours taken for vacation and the number of hours taken as sick leave. ``` -- Uses AdventureWorks SELECT p.FirstName, p.LastName, VacationHours, SickLeaveHours, VacationHours + SickLeaveHours AS 'Total Hours Away' FROM HumanResources.Employee AS e JOIN Person.Person AS p ON e.BusinessEntityID = p.BusinessEntityID ORDER BY 'Total Hours Away' ASC; GO ``` ### B. Using the addition operator to add days to date and time values This example adds a number of days to a `datetime` date. ``` SET NOCOUNT ON DECLARE @startdate datetime, @adddays int; SET @startdate = 'January 10, 1900 12:00 AM'; SET @adddays = 5; SET NOCOUNT OFF; SELECT @startdate + 1.25 AS 'Start Date', @startdate + @adddays AS 'Add Date'; ``` [!INCLUDE[ssResult](../../includes/ssresult-md.md)] ``` Start Date Add Date --------------------------- --------------------------- 1900-01-11 06:00:00.000 1900-01-15 00:00:00.000 (1 row(s) affected) ``` ### C. Adding character and integer data types The following example adds an **int** data type value and a character value by converting the character data type to **int**. If a character that is not valid exists in the **char** string, the [!INCLUDE[tsql](../../includes/tsql-md.md)] returns an error. ``` DECLARE @addvalue int; SET @addvalue = 15; SELECT '125127' + @addvalue; ``` [!INCLUDE[ssResult](../../includes/ssresult-md.md)] ``` ----------------------- 125142 (1 row(s) affected) ``` ## Examples: [!INCLUDE[ssSDWfull](../../includes/sssdwfull-md.md)] and [!INCLUDE[ssPDW](../../includes/sspdw-md.md)] ### D: Using the addition operator to calculate the total number of hours away from work for each employee The following example finds the total number of hours away from work for each employee by adding the number of hours taken for vacation and the number of hours taken as sick leave and sorts the results in ascending order. ``` -- Uses AdventureWorks SELECT FirstName, LastName, VacationHours, SickLeaveHours, VacationHours + SickLeaveHours AS TotalHoursAway FROM DimEmployee ORDER BY TotalHoursAway ASC; ``` ## See Also [Operators (Transact-SQL)](../../t-sql/language-elements/operators-transact-sql.md) [Compound Operators (Transact-SQL)](../../t-sql/language-elements/compound-operators-transact-sql.md) [+= (Addition Assignment) (Transact-SQL)](../../t-sql/language-elements/add-equals-transact-sql.md) [CAST and CONVERT (Transact-SQL)](../../t-sql/functions/cast-and-convert-transact-sql.md) [Data Type Conversion (Database Engine)](../../t-sql/data-types/data-type-conversion-database-engine.md) [Data Types (Transact-SQL)](../../t-sql/data-types/data-types-transact-sql.md) [Built-in Functions (Transact-SQL)](~/t-sql/functions/functions.md) [SELECT (Transact-SQL)](../../t-sql/queries/select-transact-sql.md)