Chapter 8 SQL Functions
339
GETDATE function [Date and time]
Returns the current date and time.
GETDATE ()
The following statement returns the system date and time.
SELECT GETDATE( )
♦ SQL/92 Vendor extension.
♦
Sybase Compatible with Adaptive Server Enterprise.
HEXTOINT function [Data type conversion]
Returns the decimal integer equivalent of a hexadecimal string.
HEXTOINT (
hexadecimal-string
)
hexadecimal-string The string to be converted to an integer.
The following statement returns the value 420.
SELECT HEXTOINT ( ’1A4’ )
♦ SQL/92 Vendor extension.
♦
Sybase Compatible with Adaptive Server Enterprise.
"INTTOHEX function" on page 342
HOUR function [Date and time]
Returns a number from 0 to 23 corresponding to the hour component of a
datetime.
HOUR (
datetime-expression
)
datetime-expression The datetime.
The following statement returns the value 21:
SELECT HOUR( ’1998-07-09 21:12:13’ )
♦ SQL/92 Vendor extension.
♦
Sybase Not supported by Adaptive Server Enterprise.
Function
Syntax
Examples
Standards and
compatibility
Function
Syntax
Parameters
Examples
Standards and
compatibility
See also
Function
Syntax
Parameters
Examples
Standards and
compatibility