how to write Year(Date(Days({fn CURDATE()})-32)) in Teradata

Database
Enthusiast

how to write Year(Date(Days({fn CURDATE()})-32)) in Teradata

Hi,

Can anyone help me in converting this :

Year(Date(Days({fn CURDATE()})-32)) in teradata

Thanks !

2 REPLIES
Junior Contributor

Re: how to write Year(Date(Days({fn CURDATE()})-32)) in Teradata

Probably:

extract(year from current_date - 32)

Dieter

Enthusiast

Re: how to write Year(Date(Days({fn CURDATE()})-32)) in Teradata

If you want to extract year from the date - 32 days then this is the query

SELECT EXTRACT(YEAR FROM (CURRENT_DATE - INTERVAL '32' DAY))