These functions are only available when connected to a Teradata database.
The following functions generate a UDF call and return a date/timestamp value (these functions are available only with Teradata 14.10 or above).
Function | Description |
---|---|
Td_Sunday | Sunday immediately before date in expression |
Td_Monday | Monday immediately before date in expression |
Td_Tuesday | Tuesday immediately before date in expression |
Td_Wednesday | Wednesday immediately before date in expression |
Td_Thursday | Thursday immediately before date in expression |
Td_Friday | Friday immediately before date in expression |
Td_Saturday | Saturday immediately before date in expression |
Td_Week_Begin | Week beginning day immediately before date in expression |
Td_Week_End | Week ending day immediately before date in expression |
Td_Month_Begin | Month beginning day immediately before date in expression |
Td_Month_End | Month ending day immediately before date in expression |
Td_Quarter_Begin | Quarter beginning day immediately before date in expression |
Td_Quarter_End | Quarter ending day immediately before date in expression |
Td_Year_Begin | Year beginning day immediately before date in expression |
Td_Year_End | Year ending day immediately before date in expression |
When dragging one of the above SQL elements into a variable, a tree element such as the following is created.
Variable Creation > Input > Variables: SQL Elements pane - Calendar > Calendar Before/After Functions
- The first argument is the Date or Timestamp column or expression that, as a date, the given function is applied to.
- The second argument is optional and should either be left empty (in which case the session calendar is used) or the string literal “Teradata”, “ISO” or “Compatible” should be used to indicate the calendar to use.
- The third argument can optionally be used to specify a time value or expression that, along with the date result, will return a timestamp value instead.
The meaning of each of the “before/after” calendar functions is given in the Description column of the table above.