How to get the current date in Teradata with examples

Current Date in Teradata

In Teradata, we can fetch the current date using either CURRENT_DATE or DATE in the Select statement. Both of the build functions returns Current/Today’s date. The format of the date is ‘YYYY-MM-DD’ as below.

Current date in Teradata
Current date in Teradata

Add days to Current date in Teradata

Teradata allows to add the days to current date using either addition(+) operator or Interval function.

Method 1 :

Add days to Current date in Teradata
Add days to Current date in Teradata

Method 2 :

Lets add 15 days to current date using Interval function as below.

 Add days to current date using Interval function
Add days to current date using Interval function

Subtract days from Current Date in Teradata

If we want to get the yesterday date from the current date, we need to subtract 1 day from it. On the other hand, we can use the Interval function to subtract the days from the current date.

Method 1 :

subtract days from current date in Teradata
subtract days from current date in Teradata

Method 2:

Lets subtract 10 days from current date using Interval function as below.

Use Interval function to subtract day from current date
Use Interval function to subtract day from current date

Example for Current date usage in Teradata

Assume that we have the table Customer_Txn that contains the transaction details of customer as below.

Current date usage example
Current date usage example

If you want to fetch the transaction details for the last 15 days from this table, you can use the Current date and Interval function in the select query to get the results.

Output

Current date example in Teradata
Current date example in Teradata

Read more about Teradata DATE functions: