Someone please let me know where is the error in my code

WITH months AS
(
SELECT
‘2017-01-01’ AS ‘start_date’,
‘2017-01-31’ AS ‘end_date’
UNION
SELECT
‘2017-02-01’ AS ‘start_date’,
‘2017-02-28’ AS ‘end_date’
UNION
SELECT
‘2017-03-01’ AS ‘start_date’,
‘2017-03-31’ AS ‘end_date’
),
cross_join AS
(
SELECT *
FROM subscriptions
CROSS JOIN months
),
status AS
(
SELECT id, first_day AS month,
CASE
WHEN (segment = 87) AND
(subscription_start < first_day)
AND (
subscription_end > first_day
OR subscription_end IS NULL
) THEN 1
ELSE 0
END as is_active_87,
CASE
WHEN (segment = 30) AND
(subscription_start < first_day)
AND (
subscription_end > first_day
OR subscription_end IS NULL
) THEN 1
ELSE 0
END as is_active_30,
CASE WHEN (segment = 87) AND
(subscription_end BETWEEN first_day AND last_day) THEN 1 ELSE 0
END AS is_canceled_87,
CASE WHEN (segment = 30) AND
(subscription_end BETWEEN first_day AND last_day) THEN 1 ELSE 0
END AS is_canceled_30
FROM cross_join
)
SELECT *
FROM status
LIMIT 10;

@beta0470961732 Welcome to the forums! Please use this article:How do I format code in my posts? to format your code.