Operator add (+)

numeric op1 + numeric op2

Adds op1 and op 2, and numeric adds to numeric. The returning value's precision will correspond to the data type with the higher precision except when a BigInt value is added to a real number. In this case, the return value will be a BigDecimal.

Note: Each data type has its own precision. For the Integer type data, BigInt has the highest precision while integer has the lowest precision. For the real number type data, Currency has the highest precision while Float has the lowest precision. So, if two numeric data of different precision are added together, the return value will be the data type with the higher precision. For example, if an Integer is added to a Double, the return value must be a Double value.

Example

The return value of the following expression is 81.71.

55 + 26.71

string op1 + time op2

When a String is added to a Time value, the return value will be a String because the Time value can be changed to a String value, while the String value cannot be changed to a Time value.

Example

The return value of the following statement is It is 10:10:10.

"It is" + ToTime (10, 10, 10)

string op1 + date op2

When a String is added to a Date value, the return value will be a String because the Date value can be changed to a String value, while the String value cannot be changed to a Date value.

Example

The return value of the following statement is It is 1999-10-15.

"It is"+ToDate (1999, 10, 15)

string op1 + datetime op2

When a String is added to a DateTime value, the return value will be a String because the DateTime value can be changed to a String value, while the String value cannot be changed to a Date value.

Example

The return value of the following statement is It is 1999-10-15 09:37:15.

"It is" + CurrentDateTime ()

string op1 + string op2

The return value is a String.

Example

The return value of the following statement is It is your bike.

"It is" + "your bike."

string op1 + integer op2

When a String is added to an Integer value, the return value will be a String because the Integer value can be changed to a String value, while the String value cannot be changed to an Integer value.

Example

The return value of the following statement is The result is9.

"The result is" + 9

string op1 + number op2

When a String is added to a Number value, the return value will be a String because the Number value can be changed to a String value, while the String value cannot be changed to a Number value.

Example

The return value of the following statement is The result is9.56.

"The result is" + 9.56

string op1 + currency op2

When a String is added to a Currency value, the return value will be a String because the Currency value can be changed to a String value, while the String value cannot be changed to a Currency value.

Example

The return value of the following statement is I spent9.56.

"I spent" + ToText($9.56)

string op1 + boolean op2

When a String is added to a Boolean value, the return value will be a String because the Boolean value can be changed to a String value, while the String value cannot be changed to a Boolean value.

Example

The return value of the following statement is It is false.

"It is" + IsNull (3>2)

string op1 + text op2

When a String is added to a Text value, the return value will be a String because the Text value can be changed to a String value, while the String value cannot be changed to a Text value.

Example

The return value of the following statement is It is 07-Jul-99 7:12:21 AM.

"It is" + ToText (ToDateTime (1999, 7, 7, 7, 12, 21), "dd-MMM-yy h:mm:ss a", "AM")

date op1 + integer op2

When a Data value is added to an Integer value, the return value will be a Data value because the Integer value will have changed to a Data value.

Example

If the date is Oct. 15, 1999, the return value of the following statement is 10-25-99.

ToDate (1999, 10, 15) + 10

time op1 + integer op2

When a Time value is added to an Integer value, the return value will be a Time value because the Integer value will have changed to a Time value.

Example

If the time is 10:15:25, the return value of the following statement is 10:15:35.

ToTime (10, 15, 25) + 10

datetime op1 + integer op2

When a DateTime value is added to an Integer value, the return value will be a DateTime value because the Integer value will have changed to a DateTime value.

Example

If the datetime is Aug. 10, 1999 10:21:30, the return value of the following statement is 1999-08-10 10:21:40.

ToDateTime (1999, 8, 10, 10, 21, 30) + 10

text op1 + date op2

When a text value is added to a Data value, the return value will be a text value because the Data value can be changed to a text value, while the text value cannot be changed to a Data value.

Example

If the date is Aug.10, 1999 and the time is 10:21:30, the return value of the following statement is 10:21:301999-08-10.

ToText(ToTime(10,21,30), "hh:mm:ss") + ToDate(1999,8,10)

text op1 + time op2

When a text value is added to a Data value, the return value will be a text value because the Data value can be changed to a text value, while the text value cannot be changed to a Data value.

Example

If the date is Aug.10, 1999 and the time is 10:21:30, the return value of the following statement is 99-08-1010:21:30.

ToText(ToDate(1999,8,10), "yy-MM-dd") + ToTime(10,21,30)

text op1 + datetime op2

When a text value is added to a DateTime value, the return value will be a text value because the DateTime value can be changed to a text value while the text value cannot be changed to a DateTime value.

Example

If the date is Aug.10, 1999 and the time is 10:21:30, the return value of the following statement is false1999-08-10 10:21:30.

ToText(3<2) + ToDateTime(1999,8,10,10,21,30)

text op1 + integer op2

When a text value is added to an Integer value, the return value will be a text value because the Integer value can be changed to a text value, while the text value cannot be changed to an Integer value.

Example

The return value of the following statement is false10.

ToText(3<2) + 10

text op1 + number op2

When a text value is added to a Number value, the return value will be a text value because the Number value can be changed to a text value, while the text value cannot be changed to a Number value.

Example

The return value of the following statement is false10.56.

ToText(3<2) + 10.56

text op1 + currency op2

When a text value is added to a Currency value, the return value will be a text value because the Currency value can be changed to a text value, while the text value cannot be changed to a Currency value. Note that with this option, when a Currency value is changed to a text value, the symbol $ is not added.

Example

The return value of the following statement is false10.56.

ToText(3<2) + ToText($10.56)

text op1 + boolean op2

When a text value is added to a Boolean value, the return value will be a text value because the Boolean value can be changed to a text value, while the text value cannot be changed to a Boolean value.

Example

The return value of the following statement is falsefalse.

ToText(3<2) + IsNull (2.5)

text op1 + string op2

The return value is a String.

Example

The return value of the following statement is 25.60is a number.

ToText(25.6, 2)+"is a number."

text op1 + text op2

The return value is a text value.

Example

The return value of the following statement is 25.6and6.52.

ToText(25.6, 1)+"and"+ToText(6.52, 2)