DataConnector
SQL Compliance / Functions
In This Topic
    Functions
    In This Topic

    DataConnector supports multiple functions for different data operations. The tables below describe following functions with examples:

    String functions

    Function Description Parameters
    CONCAT(string_value1, string_value2 [, string_valueN]) Returns the string that is the concatenation of two or more string values.
    • string_value1: The first string to be concatenated.
    • string_value2: The second string to be concatenated.
    • *: The optional additional strings to be concatenated.
    FORMAT(value, format) Returns the value formatted with the specified format.
    • value: The string to format.
    • format: The string specifying the syntax of the date or numeric format.
    INDEXOF(expressionToSearch, expressionToFind [,start_location ]) Returns the starting position of the specified expression in the character string.
    • expressionToSearch: The character expression, typically a column, to search.
    • expressionToFind: The character expression to find.
    • start_location: The optional character position to start searching for expressionToFind in expressionToSearch.
    ISNULL ( check_expression , replacement_value ) Replaces null with the specified replacement value.
    • check_expression: The expression to be checked for null.
    • replacement_value: The expression to be returned if check_expression is null.
    LEFT ( character_expression , integer_expression ) Returns the specified number of characters counting from the left of the specified string.
    • character_expression: The character expression.
    • integer_expression: The positive integer that specifies how many characters will be returned counting from the left of character_expression.
    LEN(string_expression) Returns the number of characters of the specified string expression.
    • string_expression: The string expression.
    LOWER ( character_expression ) Returns the character expression with the uppercase character data converted to lowercase.
    • character_expression: The character expression.
    LTRIM(character_expression) Returns the character expression with leading blanks removed.
    • character_expression: The character expression.
    REPLACE(string_expression, string_pattern, string_replacement) Replaces all occurrences of a string with another string.
    • string_expression: The string expression to be searched. Can be a character or binary data type.
    • string_pattern: The substring to be found. Cannot be an empty string.
    • string_replacement: The replacement string.
    REPLICATE ( string_expression ,integer_expression ) Repeats the string value the specified number of times.
    • string_expression: The string to replicate.
    • integer_expression: The repeat count.
    REVERSE ( string_expression ) Returns the reverse order of the string expression.
    • string_expression: The string.
    RIGHT ( character_expression , integer_expression ) Returns the right part of the string with the specified number of characters.
    • character_expression: The character expression.
    • integer_expression: The positive integer that specifies how many characters of the character expression will be returned.
    RTRIM(character_expression) Returns the character expression after it removes trailing blanks.
    • character_expression: The character expression.
    SUBSTRING(expression,integer_start,integer_length) Returns the part of the string with the specified length; starts at the specified index.
    • expression: The character string.
    • start: The positive integer that specifies the start index of characters to return.
    • length: The positive integer that specifies how many characters will be returned.
    TOSTRING(string_value1) Converts the value of this instance to its equivalent string representation.
    • string_value1: The string to be converted.
    TRIM(character_expression) Returns the character expression with leading and trailing blanks removed.
    • character_expression: The character expression.
    UPPER ( character_expression ) Returns the character expression with lowercase character data converted to uppercase.
    • character_expression: The character expression.

    Datetime functions

    Function Description Parameters
    DATEADD (datepart , integer_number , date [, dateformat]) Returns the datetime value that results from adding the specified number (a signed integer) to the specified date part of the date.
    • datepart: The part of the date to add the specified number to. The valid values and abbreviations are year (yy, yyyy), quarter (qq, q), month (mm, m), dayofyear (dy, y), day (dd, d), week (wk, ww), weekday (dw), hour (hh), minute (mi, n), second (ss, s), and millisecond (ms).
    • number: The number to be added.
    • date: The expression of the datetime data type.
    • dateformat: The optional output date format.
    DATEDIFF ( datepart , startdate , enddate ) Returns the difference (a signed integer) of the specified time interval between the specified start date and end date.
    • datepart: The part of the date that is the time interval of the difference between the start date and end date. The valid values and abbreviations are day (dd, d), hour (hh), minute (mi, n), second (ss, s), and millisecond (ms).
    • startdate: The datetime expression of the start date.
    • enddate: The datetime expression of the end date.
    DATEFROMPARTS(integer_year, integer_month, integer_day) Returns the datetime value for the specified year, month, and day.
    • year: The integer expression specifying the year.
    • month: The integer expression specifying the month.
    • day: The integer expression specifying the day.
    DATEPART(datepart, date [,integer_datefirst]) Returns a character string that represents the specified date part of the specified date.
    • datepart: The part of the date to return. The valid values and abbreviations are year (yy, yyyy), quarter (qq, q), month (mm, m), dayofyear (dy, y), day (dd, d), week (wk, ww), weekday (dw), hour (hh), minute (mi, n), second (ss, s), millisecond (ms), microsecond (mcs), nanosecond (ns), TZoffset (tz), and ISO_WEEK (isowk,isoww).
    • date: The datetime string.
    • datefirst: The optional integer representing the first day of the week. The default is 7, Sunday.
    EOMONTH(start_date [, integer_month_to_add ]) Returns the last day of the month that contains the specified date with an optional offset.
    • start_date: The datetime expression specifying the date for which to return the last day of the month.
    • month_to_add: The optional integer expression specifying the number of months to add to start_date.
    GETDATE() Returns the current time stamp of the database system as a datetime value. This value is equal to CURRENT_TIMESTAMP and SYSDATETIME. NA
    GETUTCDATE() Returns the current time stamp of the database system formatted as a UTC datetime value. This value is equal to SYSUTCDATETIME. NA

    Mathematics functions

    Function Descriptions Parameters
    ABS ( numeric_expression ) Returns the absolute (positive) value of the specified numeric expression.
    • numeric_expression: The expression of an indeterminate numeric data type except for the bit data type.
    ACOS ( float_expression ) Returns the arc cosine, the angle in radians whose cosine is the specified float expression.
    • float_expression: The float expression that specifies the cosine of the angle to be returned. Values outside the range from -1 to 1 return null.
    ASIN ( float_expression ) Returns the arc sine, the angle in radians whose sine is the specified float expression.   
    • float_expression: The float expression that specifies the sine of the angle to be returned. Values outside the range from -1 to 1 return null.
    ATAN ( float_expression ) Returns the arc tangent, the angle in radians whose tangent is the specified float expression.         
    • float_expression: The float expression that specifies the tangent of the angle to be returned.
    ATN2 ( float_expression1 , float_expression2 ) Returns the angle in radians between the positive x-axis and the ray from the origin to the point (y, x) where x and y are the values of the two specified float expressions.   
    • float_expression1: The float expression that is the y-coordinate.
    • float_expression2: The float expression that is the x-coordinate.
    CEILING ( numeric_expression ) Returns the smallest integer greater than or equal to the specified numeric expression.    
    • numeric_expression: The expression of an indeterminate numeric data type except for the bit data type.
    COS ( float_expression ) Returns the trigonometric cosine of the specified angle in radians in the specified expression.   
    • float_expression: The float expression of the specified angle in radians.
    COT ( float_expression ) Returns the trigonometric cotangent of the angle in radians specified by float_expression.    
    • float_expression: The float expression of the angle in radians.
    DEGREES ( numeric_expression ) Returns the angle in degrees for the angle specified in radians.    
    • numeric_expression: The angle in radians, an expression of an indeterminate numeric data type except for the bit data type.
    EXP ( float_expression ) Returns the exponential value of the specified float expression. For example, EXP(LOG(20)) is 20. Evaluates the expression. 
    • float_expression: The float expression                 
    FLOOR ( numeric_expression ) Returns the largest integer less than or equal to the numeric expression.  
    • numeric_expression: The expression of an indeterminate numeric data type except for the bit data type.
    LOG ( float_expression [, base ] ) Returns the natural logarithm of the specified float expression.
    • float_expression: The float expression.
    • base: The optional integer argument that sets the base for the logarithm.
    LOG10 ( float_expression ) Returns the base-10 logarithm of the specified float expression.       
    • float_expression: The expression of type float.
    PI ( ) Returns the constant value of pi.       NA
    POWER ( float_expression , y ) Returns the value of the specified expression raised to the specified power.              
    • float_expression: The float expression.
    • y: The power to raise float_expression to.
    RADIANS ( float_expression ) Returns the angle in radians of the angle in degrees.   
    • float_expression: The degrees of the angle as a float expression.
    RAND ( [ integer_seed ] ) Returns a pseudorandom float value from 0 through 1, exclusive.   
    • seed: The optional integer expression that specifies the seed value. If seed is not specified, a seed value at random will be assigned.
    ROUND ( numeric_expression , integer_length [ ,function ] ) Returns the numeric value rounded to the specified length or precision.          
    • numeric_expression: The expression of a numeric data type.
    • length: The precision to round the numeric expression to.
    • function: The optional type of operation to perform. When the function parameter is omitted or has a value of 0 (default), numeric_expression is rounded. When a value other than 0 is specified, numeric_expression is truncated.
    SIGN ( numeric_expression ) Returns the positive sign (1), 0, or negative sign (-1) of the specified expression.   
    • numeric_expression: The expression of an indeterminate data type except for the bit data type.
    SIN ( float_expression ) Returns the trigonometric sine of the angle in radians.   
    • float_expression: The float expression specifying the angle in radians.
    SQRT ( float_expression ) Returns the square root of the specified float value.   
    • float_expression: The expression of type float.
    SQUARE ( float_expression ) Returns the square of the specified float value.     
    • float_expression: The expression of type float.
    TAN ( float_expression ) Returns the tangent of the input expression.     
    • float_expression: The expression of type float.

    Aggregate functions

    Function Description
    COUNT Returns the number of rows matching the query criteria.
    COUNT_DISTINCT Returns the number of distinct, non-null field values matching the query criteria.
    AVG Returns the average of the column values.
    MIN  Returns the minimum column value.
    MAX Returns the maximum column value.
    SUM Returns the total sum of the column values.