[
https://issues.apache.org/jira/browse/TRAFODION-2815?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16263144#comment-16263144
]
ASF GitHub Bot commented on TRAFODION-2815:
-------------------------------------------
Github user DaveBirdsall commented on a diff in the pull request:
https://github.com/apache/incubator-trafodion/pull/1309#discussion_r152650148
--- Diff:
docs/sql_reference/src/asciidoc/_chapters/sql_functions_and_expressions.adoc ---
@@ -2325,82 +2328,206 @@ following abbreviations:
* `startdate`
+
-may be of type DATE or TIMESTAMP.
+may be of type DATE or TIMESTAMP, should be enclosed in quotation marks.
See <<datetime_value_expressions,Datetime Value Expressions>>.
* `enddate`
+
-may be of type DATE or TIMESTAMP.
+may be of type DATE or TIMESTAMP, should be enclosed in quotation marks.
See <<datetime_value_expressions,Datetime Value Expressions>>.
-The method of counting crossed boundaries such as days, minutes, and
-seconds makes the result given by DATEDIFF consistent across all data
-types. The result is a signed integer value equal to the number of
-datepart boundaries crossed between the first and second date.
-
-For example, the number of weeks between Sunday, January 4, and Sunday,
-January 1 , is 1. The number of months between March 31 and April 1
-would be 1 because the month boundary is crossed from March to April.
-The DATEDIFF function generates an error if the result is out of range
-for integer values. For seconds, the maximum number is equivalent to
-approximately 68 years. The DATEDIFF function generates an error if a
-difference in weeks is requested and one of the two dates precedes
-January 7 of the year 0001.
+[[considerations_for_datediff]]
+=== Considerations for DATEDIFF
+
+[[boundary]]
+==== Boundary
+
+The method of counting crossed boundaries such as days, minutes, and
seconds makes the result given by DATEDIFF consistent across all data types.
+
+The result is a signed integer value equal to the number of _datepart_
boundaries crossed between _startdate_ and _enddate_, because the DATEDIFF
function does not calculate the full _datepart_, it counts the difference
between _startdate_ and _enddate_.
+
+For example:
+
+* The difference between 2017-12-31 23:59:59 and 2018-01-01 00:00:00 is
only a single second.
+
++
+However, the DATEDIFF difference is 1 minute, 1 hour, 1 day, 0 week^1^, 1
month, 1 quarter or 1 month depending on the specified _datepart_.
+
++
+^1^ NOTE: 2017-12-31 (_startdate_) falls on Sunday which cannot be
counted. For more information, see <<the_first_day_of_week,The first day of
week>>.
--- End diff --
Perhaps you mean: 2017-12-31 (_startdate_) falls on a Sunday, which is in
the same week as 2018-01-01. For more information...
> Add/Update Syntax, Consideration and Example of *DATEDIFF Function* for
> *Trafodion SQL Reference Manual*
> --------------------------------------------------------------------------------------------------------
>
> Key: TRAFODION-2815
> URL: https://issues.apache.org/jira/browse/TRAFODION-2815
> Project: Apache Trafodion
> Issue Type: Documentation
> Reporter: Liu Yu
> Assignee: Liu Yu
>
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)