Basic Syntax CrystalClear Syntax

Operator "+"


This operator "adds" the two operands and returns the result. Depending on the value types of the two operands, the value type of the result can be the same as one of the two operands or even a completely different value type, as in the case of a date plus a time, which returns a datetime.

Note the special meaning of the "+" operator in connection with dates:

Usage:

number1 + number2	// Returns number
number + currency	// Returns currency
time + number	// Returns time
date + time	// Returns datetime
date + number	// Returns date
datetime + time	// Returns datetime
datetime + number	// Returns datetime
time + number	// Returns time
string1 + string2	// Returns string

Returns:

depends on operand value types

Examples (Same in Basic and Crystal syntax):

21 + 21					// Returns 42
21 + $21					// Returns $42
time(12,00,00) + 73			// Returns 12:01:13
date(2005,12,12) + time(5,5,5)		// Returns 12/12/2005, 5:05:05 a.m.
date(2005,12,12) + 42			// Returns 1/23/2006
datetime(2005,12,12,5,5,5) + time(5,5,5)	// Returns 12/12/2005, 10:10:10 a.m.
datetime(2005,12,12,5,5,5) + 42		// Returns 1/23/2006, 5:05:05 a.m.
"this is" + " a test"			// Returns "this is a test"

See also:


i-net software strives to provide accurate product documentation. Please give us your feedback using the form below.
NOTE: This form is for documentation feedback only. For technical assistance, please send an email to crystalclear@inetsoftware.de.

This page is: very poor very good
Comment: