I am new to Teradata coding and to this forum. If i am not posting on the right place request the moderator to move accordingly. Thanks
I wanted to write the below logic in teradata coding.
Logic : if today minus 3 month falls on sunday then +1 else today minus 3 months falls on monday then +2 else today minus 3 months end.
i have written below logic but it is giving me error, i request some one please help me where i am missing or suggest me the best practices:
WHEN (Day_Of_Week =1) then (ADD_MONTHS(Current_Date,-3) + 1)
WHEN (Day_Of_Week =2) then (ADD_MONTHS(Current_Date,-3) + 2)
Where Calendar_Date = ADD_MONTHS(Current_Date,-3)
--1 Sun --2 Mon --3 Tue --4 Wed --5 thur --6 Fri --7 Sat