Home > OS >  SQL date filter operator
SQL date filter operator

Time:04-21

Just a general date filter question, what are the valid operators for me to filter a specific timeframe as I had this error:

Cannot apply operator: date <= varchar(8)

code:

where utc_date >= '2022-04-01'    

data type = date

CodePudding user response:

'2022-04-01' is a varchar literal, you need to convert it to date for example by prefixing it with date:

where utc_date >= date '2022-04-01'    
  • Related