Following are Math operators. You can go into them to get detailed information.
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
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
Adds x and y, 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
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)
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)
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)
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 ()
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
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
The return value is a String.
Examples
"It is" + "your bike."
String URL="http://localhost:8888/jinfonet/runReport.jsp?";
String Reports = "&jrs.report_sheet$report2=true";
String Catalog = "&jrs.catalog=/SampleReports.cat";
String ReportSet = "&jrs.report=/SaleStat_detail.cls";
String resultType = "&jrs.result_type=8";
String para = "&jrs.param$P_Year=@INNER";
String para1 = "&jrs.param$p_AccountManagerName=" + "Jeremy Miner";
This formula sets an URL, which can run one demo report on the JReport Server.
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")
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)
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)
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)
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)
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)
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
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
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."
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)
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)
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
When a Data value subtracts a Data value, the return value will be an Integer. The result is the number of days between the two dates.
Examples
ToDate(1999, 12, 12) - ToDate(1995, 12, 12)
if ((todate(@"Due Date")-CurrentDate())<0)
{return '0xff0000'}//red
else
{return '0x000000'}//black
This formula sets values' background, in which way it can highlight report values that are out of range.
When a Data value subtracts an Integer value, the return value will be a Data value because the Integer value will have changed into a Data value.
Example
If the date is Oct. 18, 1999, the return value of the following statement is 10/16/99.
ToDate(1999, 10, 18) - 2
When a DateTime value subtracts a DateTime value, the return value will be an Integer. The result is the number of seconds between the two DateTimes.
Example
If one timestamp is 1999-12-12 10:10:10, and the other timestamp is 1995-12-12 10:10:10, the return value of the following statement is 126230400.
ToDateTime(1999, 12, 12, 10, 10, 10) - ToDateTime(1995, 12, 12, 10, 10, 10)
When a DateTime value subtracts an Integer value, the return value will be a DateTime value because the Integer value will have changed into a DateTime value.
Example
If the date is Oct. 18, 1999, the time is 10:10:10, the return value of the following statement is 1999-10-18 10:10:08.
ToDateTime(1999, 10, 18, 10, 10, 10) - 2
Subtracts y from x, and numeric subtracts numeric. The precision of the return value will correspond to the data type with the higher precision.
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 datum of different precision subtracts each other, the return value will be of the data type with the higher precision. For example, if an Integer subtracts a Double, the return value will be a Double value.
Example
The return value of the following expression is 61.71.
87.71 - 26
When a Time value subtracts an Integer value, the return value will be a Time value because the Integer value will have changed into a Time value.
Example
If the time is 10:10:10, the return value of the following statement is 10:10:08.
ToTime(10, 10, 10) - 2
When a Time value subtracts a Time value, the return value will be an Integer. The result is the number of seconds between the two times.
Example
If one time is 08:08:08, and the other time is 10:10:10, the return value of the following statement is 7322.
ToTime(10, 10, 10) - ToTime(8, 8, 8)
Multiplies x by y. When a Currency value is multiplied by a Currency value, the return value will be a Currency value.
Example
The return value of the following statement is 2.88.
$2.4 * $1.2
Multiplies x by y. When a Currency value is multiplied by an Integer value, the return value will be a Currency value.
Example
The return value of the following statement is 106.75.
$4.27 * 25
Multiplies x by y. When a Currency value is multiplied by a Number value, the return value will be a Currency value.
Example
The return value of the following statement is 3.25.
$1.27 * 2.56
Multiplies x by y. When an Integer value is multiplied by a Currency value, the return value will be a Currency value.
Example
The return value of the following statement is 106.75.
25 * $4.27
Multiplies x by y. When an Integer value is multiplied by an Integer value, the return value will be an Integer value.
Example
The return value of the following statement is 15.
3 * 5
Multiplies x by y. When an Integer value is multiplied by a Number value, the return value will be a Number value.
Example
The return value of the following statement is 104.25.
25 * 4.17
Multiplies x by y. When a Number value is multiplied by a Currency value, the return value will be a Currency value.
Example
The return value of the following statement is 3.25.
2.56 * $1.27
Multiplies x by y. When a Number value is multiplied by an Integer value, the return value will be a Number value.
Example
The return value of the following statement is 104.25.
4.17 * 25
Multiplies x by y. When a Number value is multiplied by a Number value, the return value will be a Number value.
Example
The return value of the following statement is 2.88.
2.4 * 1.2
Divides x by y. When a Currency is divided by a Currency value, the return value will be an Integer or a Currency value.
Example
The return value of the following statement is 1.77.
$4.52 / $2.56
Divides x by y. When a Currency is divided by an Integer, the return value will be a Currency value.
Example
The return value of the following statement is 1.28.
$2.56 / 2
Divides x by y. When a Currency is divided by a Number value, the return value will be an Integer or a Currency value.
Example
The return value of the following statement is 1.79.
$4.52 / 2.52
Divides x by y. When an Integer is divided by a Currency value, the return value will be a Currency or an Integer.
Example
The return value of the following statement is 21.87.
56 / $2.56
Divides x by y. When an Integer is divided by an Integer, the return value will be an Integer or a Number value.
Example
56 / 3
- Return 18.67
10 / 3
- Return 3.33
Divides x by y. When an Integer is divided by a Number value, the return value will be a Number or an Integer.
Example
The return value of the following statement is 21.88.
56 / 2.56
Divides x by y. When a Number is divided by a Currency value, the return value will be a Currency value.
Example
The return value of the following statement is 1.77.
4.52 / $2.56
Divides x by y. When a Number is divided by an Integer, the return value will be a Number value.
Example
The return value of the following statement is 0.51.
2.55 / 5
Divides x by y. When a Number is divided by a Number value, the return value will be an Integer or a Number value.
Example
The return value of the following statement is 1.77.
4.52 / 2.56
Divides x by y, and returns an Integer result.
Examples
39.4 \ 3
- Return 13.0010 \ 3
- Return 3.00Returns the opposite value of x. If a Currency value is positive, the return value will be negative. If the Currency value is negative, the return value will be positive.
Examples
-$2.57
-(-$2.57)
Returns the opposite value of x. If an Integer value is positive, the return value will be negative. If the Integer value is negative, the return value will be positive.
Examples
-25
-(-25)
Returns the opposite value of x. If a Number value is positive, the return value will be negative. If the Number value is negative, the return value will be positive.
Examples
-5.28
-(-5.28)
Computes the percentage of dividing x by y. When a Currency value is divided by a Currency value, the return value will be an Integer or a Currency.
Example
The return value of the following statement is 176.56.
4.52%2.56
Computes the percentage of dividing x by y. When a Currency value is divided by an Integer value, the return value will be an Integer or a Currency.
Example
The return value of the following statement is 226.
$4.52%2
Computes the percentage of dividing x by y. When a Currency value is divided by a Number value, the return value will be an Integer or a Currency.
Example
The return value of the following statement is 120.
$1.44%1.2
Computes the percentage of dividing x by y. When an Integer value is divided by a Currency, the return value will be an Integer or a Currency.
Example
The return value of the following statement is 40.
1%$2.5
Computes the percentage of dividing x by y. When an Integer value is divided by an Integer, the return value will be an Integer or a Number.
Example
The return value of the following statement is 77.78.
7%9
Computes the percentage of dividing x by y. When an Integer value is divided by a Number, the return value will be a Number or an Integer.
Example
The return value of the following statement is 400.
6%1.5
Computes the percentage of dividing x by y. When a Number value is divided by a Currency, the return value will be an Integer or a Currency value.
Example
The return value of the following statement is 500.
2.5%$0.5
Computes the percentage of dividing x by y. When a Number value is divided by an Integer, the return value will be an Integer or a Number.
Example
The return value of the following statement is 50.
2.5%5
Computes the percentage of dividing x by y. When a Number value is divided by a Number, the return value will be an Integer or a Number.
Example
The return value of the following statement is 176.56.
4.52%2.56
Raise x to the power of y. y can be fractional, positive or negative. x can be fractional, but negative only when y is a whole number.
Examples
2^2
7^3.8