Calculating time difference between 2 dates in Teradata

16,450

You can try like this:

SELECT CURRENT_DATE - CAST('2016-06-06' AS DATE) MONTH(4);

and if your date is in dd/mm/yyyy format then you can try like

SELECT CURRENT_DATE - cast(myDate as date format 'YYYY-MM-DD') MONTH(4);
Share:
16,450
sagivmal
Author by

sagivmal

Updated on June 14, 2022

Comments

  • sagivmal
    sagivmal almost 2 years

    I'm trying to calculate time difference (in months) between the current date, and the date the customer opened his account (only for those who joined in January 2012).
    I try to use current_date and cast, but I think my problem is in my date field which is in the following format: dd/mm/yyyy
    I'm working on Teradata.
    Your help will be appreciated.

  • DS R
    DS R about 4 years
    What is the significance of adding month(4) at the end? Can you share some reference?