[
https://issues.apache.org/jira/browse/CALCITE-1827?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Julian Hyde updated CALCITE-1827:
---------------------------------
Description:
Document TIMESTAMPADD, TIMESTAMPDIFF functions.
(Initial request was to add {{DATEADD}} as built-in scalar function, as
follows. But it turns out that TIMESTAMPADD is similar enough.)
Syntax: {{DATEADD (datepart , number , date )}}
Arguments:
* datepart - Is the part of date to which an integer number is added.
* number - Is an expression that can be resolved to an int that is added to a
datepart of date
* date - Is an expression that can be resolved to a time.
Example
{code}SELECT DATEADD(month, 1, '2017-05-31') from tab;{code}
returns {{2017-06-30 00:00:00.000}}
MSSQL: https://docs.microsoft.com/en-us/sql/t-sql/functions/dateadd-transact-sql
MySql:
https://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html#function_date-add
was:
Syntax: {{DATEADD (datepart , number , date )}}
Arguments:
* datepart - Is the part of date to which an integer number is added.
* number - Is an expression that can be resolved to an int that is added to a
datepart of date
* date - Is an expression that can be resolved to a time.
Example
{code}SELECT DATEADD(month, 1, '2017-05-31') from tab;{code}
returns {{2017-06-30 00:00:00.000}}
MSSQL: https://docs.microsoft.com/en-us/sql/t-sql/functions/dateadd-transact-sql
MySql:
https://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html#function_date-add
> Document TIMESTAMPADD, TIMESTAMPDIFF functions
> ----------------------------------------------
>
> Key: CALCITE-1827
> URL: https://issues.apache.org/jira/browse/CALCITE-1827
> Project: Calcite
> Issue Type: New Feature
> Components: core
> Reporter: sunjincheng
> Assignee: sunjincheng
> Fix For: 1.13.0
>
>
> Document TIMESTAMPADD, TIMESTAMPDIFF functions.
> (Initial request was to add {{DATEADD}} as built-in scalar function, as
> follows. But it turns out that TIMESTAMPADD is similar enough.)
> Syntax: {{DATEADD (datepart , number , date )}}
> Arguments:
> * datepart - Is the part of date to which an integer number is added.
> * number - Is an expression that can be resolved to an int that is added to a
> datepart of date
> * date - Is an expression that can be resolved to a time.
> Example
> {code}SELECT DATEADD(month, 1, '2017-05-31') from tab;{code}
> returns {{2017-06-30 00:00:00.000}}
> MSSQL:
> https://docs.microsoft.com/en-us/sql/t-sql/functions/dateadd-transact-sql
> MySql:
> https://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html#function_date-add
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)