Cannot cast type boolean to date

I am attempting to use the following query:

SELECT *
FROM shipping
WHERE CASE
	WHEN {{ time.value }} = 'day' 
	THEN ({{ !date79.value }} OR ship_date = {{ date79.value }})
	WHEN {{ time.value }} = 'week'
	THEN ship_date BETWEEN {{ moment(new Date()).startOf('day') }} AND {{ moment(new Date()).add(7, 'days').endOf('day') }}
	WHEN {{ time.value }} = 'month'
	THEN EXTRACT(MONTH FROM shipped::date) = {{ select62.value }}
	END;

I have been working on it all morning, but I keep getting the error message "cannot cast type boolean to date".

If someone can tell me what is wrong with my SQL statement I would really appreciate it.

Hi @tomm ! I believe the issue lies with line 9, THEN EXTRACT(MONTH FROM shipped::date) = {{ select62.value }}

Can you double check what the datatype of column shipped is? It looks like it may be a boolean (ie, shipped = true or shipped = false) which can't covert to a date.