Calculate time difference in SQL / Teradata
Raymond visibility 5,947 event 2019-11-18 access_time 5 years ago language English
This code snippet shows how to calculate time differences.
DATEDIFF function is not implemented in Teradata. Thus we need to use other approach to calculate time difference.
-- for calculate days difference, we can directly use minus (-) operator SELECT DATE'2019-07-16' - DATE'2019-06-01' AS Diff_Days; -- month different SELECT (DATE'2019-07-16' - DATE'2019-06-01') MONTH(4) AS Diff_Months;
info Last modified by Raymond 5 years ago copyright This page is subject to Site terms.
No comments yet.