@@ -93,6 +93,48 @@ include-tagged::{sql-specs}/docs.csv-spec[dtIntervalMul]
9393
9494beta[]
9595
96+ [[sql-functions-current-date]]
97+ ==== `CURRENT_DATE/CURDATE`
98+
99+ .Synopsis:
100+ [source, sql]
101+ --------------------------------------------------
102+ CURRENT_DATE
103+ CURRENT_DATE()
104+ --------------------------------------------------
105+
106+ *Input*: _none_
107+
108+ *Output*: date
109+
110+ .Description:
111+
112+ Returns the date (no time part) when the current query reached the server.
113+ It can be used both as a keyword: `CURRENT_DATE` or as a function with no arguments: `CURRENT_DATE()`.
114+
115+ [NOTE]
116+ Unlike CURRENT_DATE, `CURDATE()` can only be used as a function with no arguments and not as a keyword.
117+
118+ This method always returns the same value for its every occurrence within the same query.
119+
120+ ["source","sql",subs="attributes,callouts,macros"]
121+ --------------------------------------------------
122+ include-tagged::{sql-specs}/docs.csv-spec[curDate]
123+ --------------------------------------------------
124+
125+ ["source","sql",subs="attributes,callouts,macros"]
126+ --------------------------------------------------
127+ include-tagged::{sql-specs}/docs.csv-spec[curDateFunction]
128+ --------------------------------------------------
129+
130+ Typically, this function (as well as its twin <<sql-functions-today,TODAY())>> function
131+ is used for relative date filtering:
132+
133+ ["source","sql",subs="attributes,callouts,macros"]
134+ --------------------------------------------------
135+ include-tagged::{sql-specs}/docs.csv-spec[filterToday]
136+ --------------------------------------------------
137+
96138[[sql-functions-current-timestamp]]
97139==== `CURRENT_TIMESTAMP`
98140
@@ -115,7 +157,7 @@ Returns the date/time when the current query reached the server.
115157As a function, `CURRENT_TIMESTAMP()` accepts _precision_ as an optional
116158parameter for rounding the second fractional digits (nanoseconds).
117159
118- This method always returns the same value within a query.
160+ This method always returns the same value for its every occurrence within the same query.
119161
120162["source","sql",subs="attributes,callouts,macros"]
121163--------------------------------------------------
@@ -422,7 +464,8 @@ NOW()
422464.Description:
423465
424466This function offers the same functionality as <<sql-functions-current-timestamp,CURRENT_TIMESTAMP()>> function: returns
425- the datetime when the current query reached the server. This method always returns the same value within a query.
467+ the datetime when the current query reached the server. This method always returns the same value for its every
468+ occurrence within the same query.
426469
427470["source","sql",subs="attributes,callouts,macros"]
428471--------------------------------------------------
@@ -485,6 +528,38 @@ Extract the year quarter the date/datetime falls in.
485528include-tagged::{sql-specs}/docs.csv-spec[quarter]
486529--------------------------------------------------
487530
531+ [[sql-functions-today]]
532+ ==== `TODAY`
533+
534+ .Synopsis:
535+ [source, sql]
536+ --------------------------------------------------
537+ TODAY()
538+ --------------------------------------------------
539+
540+ *Input*: _none_
541+
542+ *Output*: date
543+
544+ .Description:
545+
546+ This function offers the same functionality as <<sql-functions-current-date,CURRENT_DATE()>> function: returns
547+ the date when the current query reached the server. This method always returns the same value for its every occurrence
548+ within the same query.
549+
550+ ["source","sql",subs="attributes,callouts,macros"]
551+ --------------------------------------------------
552+ include-tagged::{sql-specs}/docs.csv-spec[todayFunction]
553+ --------------------------------------------------
554+
555+ Typically, this function (as well as its twin <<sql-functions-current-timestamp,CURRENT_TIMESTAMP())>> function is used
556+ for relative date filtering:
557+
558+ ["source","sql",subs="attributes,callouts,macros"]
559+ --------------------------------------------------
560+ include-tagged::{sql-specs}/docs.csv-spec[filterToday]
561+ --------------------------------------------------
562+
488563[[sql-functions-datetime-week]]
489564==== `WEEK_OF_YEAR/WEEK`
490565
0 commit comments