Date functions supported
KISAM does not have a data type for TIME data or for time stamps so only DATE functions are available.
Function | Description |
---|---|
CURDATE( ) | Returns the current date as a date value. |
CURTIME( ) | Returns the current local time as a time value. | DAYNAME(date_exp) | Returns a character string containing the name of the day (for example, Sunday). |
DAYOFMONTH(date_exp) | Returns the day of the month in date_exp as an integer value in the range of 1-31. |
DAYOFWEEK(date_exp) | Returns the day to the week in date_exp as an integer value in the range of 1-7, where 1 represents Sunday. |
DAYOFYEAR(date_exp) | Returns the day of the year in date_exp as an integer value in the range of 1-366. |
HOUR(time_exp) | Returns the hour in time_exp as an integer value in the range of 0-23. |
MINUTE(time_exp) | Returns the minute in time_exp as an integer value in the range of 0-59. |
MONTH(date_exp) | Returns the month in date_exp as an integer value in the range of 1-12. |
MONTHNAME(date_exp) | Returns a character string containing the name of the month (for example January) |
NOW( ) | Returns current date and time as a timestamp value. |
QUARTER(date_exp) | Returns the quarter in date_exp as an integer value in the range of 1- 4, where 1 represents January 1 through March 31. |
SECOND(time_exp) | Returns the second in time_exp as an integer value in the range of 0-59. |
TIMESTAMPADD(interval, integer_exp, timestamp_exp) | Returns the timestamp calculated by adding integer_exp intervals of type interval to timestamp_exp. Valid values of interval are the following keywords:
SQL_TSI_DAY SQL_TSI_WEEK SQL_TSI_MONTH SQL_TSI_QUARTER SQL_TSI_YEAR |
TIMESTAMPDIFF(interval, timestamp_exp1, timestamp_exp2) | Returns the integer number of intervals of type interval by which timestamp_exp2 is greater than timestamp_exp1. Valid values of interval are the following keywords: SQL_TSI_DAY
SQL_TSI_WEEK SQL_TSI_MONTH SQL_TSI_QUARTER SQL_TSI_YEAR |
WEEK(date_exp) | Returns the week of the year in date_exp as an integer value in the range of 1-53. |
YEAR(date_exp) | Returns the year in date_exp as an integer value. |