User Churn - Codeflix Step 5

I’m having a problem with this project. Below is the link to my code. I’ve copied it verbatim from the project video. I even read the code backward to find the bug. It does not run – and I have no clue why. Someone please help.

Here is a link to the project.

I fixed the problem. Apparently when you are setting values in a CASE WHEN statement, you need the values placed in quotes (EVEN IF IT’S NUMBERS). That is the only thing I fixed – and it now works.

The values don’t need to be in quotes, you just had a typo the first time.

Here is your original code, where you wrote “subcription”:

And here is your revised code, with the properly spelled “subscription”:

I tested it out in Codecademy and the code with “subcription” doesn’t run, even though it is after an OR statement. However, once the typo is fixed it runs without the numbers being in quotes.

On another note, your logic should be changed from:

(subscription_end > first_day OR subscription_end IS NULL)

which checks if the subscription was active for the first day of the month, to this:

(subscription_end >= last_day OR subscription_end IS NULL)

which checks if the subscription was active for at least the whole month.

Happy coding!