I am having a peoples data set with students (student=1) and I need to monitor these students on a weekkly basis.
How can I filter data for a specific date and then monitor it after 7 days and after 14 days?
something like this.
Only this part works: (CASE WHEN (student = 1) and (start_date = '2015-04-01 00:00:00') THEN 1 ELSE 0 END) AS date_to_monitor, I think the
date_add` gives mme grieve, as it is complaining about a Boolean type
Select *,
(CASE WHEN (student = 1) and (start_date = '2015-04-01 00:00:00') THEN 1 ELSE 0 END) AS date_to_monitor,
(CASE WHEN (student= 1) and (date_add(start_date = '2018-11-01 00:00:00' , 7)) THEN 1 ELSE 0 END) AS date_to_monitor,
(CASE WHEN (student= 1) and (date_add(start_date = '2018-11-01 00:00:00' , 14)) THEN 1 ELSE 0 END) AS date_to_monitor,
from old;