DateAdd and DateDiff function in Teradata?

Database

DateAdd and DateDiff function in Teradata?

hi guys ,

 

i have some problem with convertion of that line to TeraData:

where (((dateadd(YEAR, DATEDIFF (YEAR,a.[DATE],@StartDate) , a.[DATE]) between @StartDate and @EndDate) and EventName='BirthDay')

 

someone know how to do that correct?

 

 

 

1 REPLY
N/A

Re: DateAdd and DateDiff function in Teradata?

This logic checks for people having birthday between start and end.

 

where
    Add_Months("DATE", Cast((@StartDate - "DATE" YEAR) AS INT) * 12) -- birthday within the current year
between @StartDate and @EndDate and EventName='BirthDay'