+ (Add) (SQL Server Compact Edition)

Adds two numbers. This addition arithmetic operator also can add a number, in days, to a date.


expression + expression


  • expression
    Any valid expression in Microsoft SQL Server 2005 Compact Edition of any of the data types in the numeric category, except the bit data type.

Result Types

Returns the data type of the argument with the higher precedence.

Code Example

In the following example, you want to create a target total, which is the current number of customers plus 50. The following example adds 50 to the total number of current customers. This result of the query in this example assumes that there are 90 current customers listed in the Customers table.

SELECT COUNT(CustomerID) + 50 AS "Target Total" FROM Customers

This is the result set:

Target Total