New to the forum. I am looking to use a CASE WHEN function based on two separate fields . Those fields are order day
and Month
. Month
is a calculation from:
DATEPART (Month, order_day ) AS Month
The code I have is below, but not getting the desired result. Want to say when order day
is between x dates, then have the data in the Month
column 1, otherwise give me the normal data that appears in the Month
column.
when order_day between to_date ('20201227', 'YYYYMMDD') and TO_DATE ('20201231', 'YYYYMMDD') THEN Month = '1'
else Month End As Month2