Get results from previoius week in mysql

Hello,

I’m wanting to get results from previous week. I’m currently using a CASE statement that’s returning results for current week. Here is my CASE statement:

CASE WHEN WEEK(submissions.process_date, 1) = WEEK(CURRENT_DATE, 1) THEN 1 ELSE 0 END

Would anyone know how I can alter this to return previous week results? Greatly appreciated.

I almost want to kick myself. I think this is the solutions. I’m going to test. Yup, just adding that -1 to the statement.

Solution: CASE WHEN WEEK(submissions.process_date, 1) = WEEK(CURRENT_DATE, 1) - 1 THEN 1 ELSE 0 END

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.