Hello I need a CASE statement that will be marking data that was one week before.
CASE statement that will mark data '1 week before'. it should basically mark rows where 'STARTDATE' is equals to one week before.
If today (1/13/2021) it should look at the data '1/2/2021' and return 'Data one week before'.
This column has only Sunday dates namely 1/02, 1/09 etc. I need this column to return value 'Data one week before' if it equals to 1/02 for example today.
This query should be dynamic and readjust itself each week.
,[STARTDATE] FROM [BYIntegration].[SCPOMGR].[FCSTPERFSTATIC]
Obviously CASE WHEN [STARTDATE] = '1-02-2022' THEN '1 week before' ELSE 'Not relevant' END AS 'Date from prior week' but this is not right because I need that '1-02-2022' to change every week.
- This topic was modified 4 months ago by JeremyU.