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);
Author by
sagivmal
Updated on June 14, 2022Comments
-
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 usecurrent_date
andcast
, 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 about 4 yearsWhat is the significance of adding month(4) at the end? Can you share some reference?