@@ -93,6 +93,48 @@ include-tagged::{sql-specs}/docs.csv-spec[dtIntervalMul]
93
93
94
94
beta[]
95
95
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
+
96
138
[[sql-functions-current-timestamp]]
97
139
==== `CURRENT_TIMESTAMP`
98
140
@@ -115,7 +157,7 @@ Returns the date/time when the current query reached the server.
115
157
As a function, `CURRENT_TIMESTAMP()` accepts _precision_ as an optional
116
158
parameter for rounding the second fractional digits (nanoseconds).
117
159
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.
119
161
120
162
["source","sql",subs="attributes,callouts,macros"]
121
163
--------------------------------------------------
@@ -422,7 +464,8 @@ NOW()
422
464
.Description:
423
465
424
466
This 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.
426
469
427
470
["source","sql",subs="attributes,callouts,macros"]
428
471
--------------------------------------------------
@@ -485,6 +528,38 @@ Extract the year quarter the date/datetime falls in.
485
528
include-tagged::{sql-specs}/docs.csv-spec[quarter]
486
529
--------------------------------------------------
487
530
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
+
488
563
[[sql-functions-datetime-week]]
489
564
==== `WEEK_OF_YEAR/WEEK`
490
565
0 commit comments