TD_TIME_BUCKET_NUMBER Syntax | Teradata Vantage - TD_TIME_BUCKET_NUMBER Syntax - Advanced SQL Engine - Teradata Database

Time Series Tables and Operations

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-22
dita:mapPath
cxa1555383531762.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1208
lifecycle
previous
Product Category
Teradata Vantageā„¢
[TD_SYSFNLIB.] TD_TIME_BUCKET_NUMBER ( timezero, timecode, timebucket_duration )

Syntax Elements

TD_SYSFNLIB
The name of the database where the function is located.
timezero

Any expression evaluating to a DATE or TIMESTAMP that is used as time zero for this function. A time zone for the timestamp is optional.

timecode
Any expression evaluating to a DATE or TIMESTAMP that is used as the timecode for this function. A time zone for the timestamp is optional.
timebucket_duration
{ CAL_YEARS |
  CAL_MONTHS |
  CAL_DAYS |
  WEEKS |
  DAYS |
  HOURS |
  MINUTES |
  SECONDS |
  MILLISECONDS |
  MICROSECONDS
} ( pos_int )
A time duration that can be specified using any of the units of time shown in the diagram. Abbreviations are allowed for the duration:
Time Unit Formal Form Example Shorthand Equivalents
Calendar Years CAL_YEARS(4) 4cy

4cyear

4cyears
Calendar Months CAL_MONTHS(5) 5cm

5cmonth

5cmonths
Calendar Days

24 hour periods starting at 00:00:00.000000 and ending at 23:59:59.999999 on the day identified by time zero.

CAL_DAYS(6) 6cd

6cday

6cdays
Weeks WEEKS(3) 3w

3week

3weeks
Days

24 hour periods starting from time zero.

DAYS(5) 5d

5day

5days
Hours HOURS(4) 4h

4hr

4hrs

4hour

4hours
Minutes MINUTES(23) 23m

23mins

23minute

23minutes
Seconds SECONDS(33) 33s

33sec

33secs

33second

33seconds
Milliseconds MILLISECONDS(12) 12ms

12msec

12msecs

12millisecond

12milliseconds
Microseconds MICROSECONDS(10) 10us

10usec

10usecs

10microsecond

10microseconds
pos_int
A 16-bit positive integer with a maximum value of 32,767.