Date Format

I want to use date(hard written like 2021-12-10) in a query with a logical operator. But I am not able to figure out correct syntax.

Sample Query

count(CASE WHEN date_format(lead_time,'%Y-%m') > '2021/01/01' THEN 1 END) as lead_count,

Hi @unique
Something like this should work.

count(CASE WHEN cast(date_format(lead_time,'%Y-%m-01') as date) >= '2021-01-01' THEN 1 END) as lead_count,

But you can likely find better help in a forum dedicated to your database type or, since it's really not specific to Metabase.

Hi @flamber
getting this
"line 4:76: Cannot apply operator: date <= varchar(10)"

@unique Okay, try asking the question in a forum that is specific to your database or