Functions that return numbers

Functions that return numbers

Description

Example

ABS

Returns the absolute value of the numeric expression

 

ATAN

Returns the arc tangent of the argument as an angle expressed in radians

 

ATAN2

Returns the arc tangent of x and y coordinates as an angle expressed in radians

 

CEIL

CEILING

Returns the smallest integer value that is greater than or equal to the argument

 

COS

Returns the cosine of the argument

COS(RADIANS(180)) returns -1

DEG

DEGREES

Returns the number of degrees of the argument, which is an angle expressed in radians

 

DAY

Returns the day part of a date

DAY(DATE '2028-01-30') returns 30

DAYOFWEEK

Returns the day of week (1-7) of a date expression

DAYOFWEEK(DATE '2004-05-01') returns 7

MOD

Divides two numbers and returns the remainder of the division

MOD(10,3) returns 1

EXP

Returns a value that is the base of the natural logarithm (e) raised to a power specified by the argument

 

FLOOR

Returns the largest integer value that is less than or equal to the argument

 

HOUR

Returns the hour part of a value

 

INT

Returns the integer part of a number

INT(6.4321) returns 6

LENGTH

Returns the length of a string

LENGTH('ABC') returns 3

MONTH

Returns the month part of a date

MONTH(DATE '2028-01-30') returns 1

LN

Returns the natural logarithm of the argument

 

LOG

Returns the common logarithm of the argument

 

MAX

Returns the larger of two numbers

MAX(66,89) returns 89

MIN

Returns the smaller of two numbers

MIN(66,89) returns 66

MINUTE

Returns the minute part of a value

 

NUMVAL

Converts a character string to a number. The function fails If the character string is not a valid number.

NUMVAL('123') returns 123

PI

Returns the constant value of the mathematical constant pi

 

RADIANS

Returns the number of radians for an argument that is expressed in degrees

 

ROUND

Rounds a number

ROUND(123.456,0) returns 123
ROUND(123.456,2) returns 123.46
ROUND(123.456,-2) returns 100

SECOND

Returns the seconds part of a value

 

SIGN

An indicator of the sign of the argument: -1 for negative, 0 for 0, and 1 for positive

 

SIN

Returns the sine of the argument

 

SQRT

Returns the square root of the argument

 

TAN

Returns the tangent of the argument

 

YEAR

Returns the year part of a date

YEAR(DATE '2028-01-30') returns 2028