Mixed data type case expression PostgresSQL I am trying to do a case expression with mixed data types with no avail. Please could I get some help with what I'm doing wrong, please see my statement below

Case 
   when c.student_age &gt; 19 
     and c.count_forms &gt; 3 
     and ss.value :: date &lt;@ fiscal_year.f_year 
       then "Y" 
   else "N" 
end as student_r_year


I'm using both int and date data in the first part of the case statement and that's where the issue is.
I could not find the definition of &lt;@, but from your description, I assume that you  mean that ss.value is the same year as fiscal_year.f_year:

Case 
   when c.student_age &gt; 19 
     and c.count_forms &gt; 3 
     and ss.value :: date BETWEEN (fiscal_year.f_year::varchar || '-01-01')::date 
                              AND (fiscal_year.f_year::varchar || '-12-31')::date
   then 'Y' 
   else 'N' 
end as student_r_year


An alternative is to extract the year from ss.value:

Case 
   when c.student_age &gt; 19 
     and c.count_forms &gt; 3 
     and extract(year from ss.value :: date) = fiscal_year.f_year
   then 'Y' 
   else 'N' 
end as student_r_year