Skip to content
Advertisement

Snowflake – Issues with table filtering on dates

I’ve created a query that produces a set of dates based on start and end date.

Everything works fine, but when I try to filter the underlying table to only produce the records between my range, it still results with all the underlying dates.

I’ve tried using between, changing the variables to dates using to_date(), nothing worked.

Any ideas?

Advertisement

Answer

The OR condition is the issue AND DATES LIKE '____-06-%' OR DATES LIKE '____-12-%':


More conscise way using LIKE ANY (…, …) syntax:

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement