I am doing sort of a code migration from Python to Teradata:
The python code is this:
max = min(datetime.today(), date + timedelta(days=90))
where date variable holds a date.
However, in Teradata, I know this min function won't work the same way. And, I have to get the 'date' using a select statement.
SEL min(SELECT CURRENT_TIMESTAMP, SEL MAX(DTM) + INTERVAL '90' DAY FROM BILLS) as max
Those select statements individually run correct. Only thing is I want the minimum of those two dates. Also, the 'SELECT CURRENT_TIMESTAMP
' is generating output like 2022-11-16 12:18:37.120000+00:00
. I only want 2022-11-16 12:18:37
. How can this be done in a single query?
Thank you.