title: Snowflake - Issues with table filtering on dates
body: <p>I've created a query that produces a set of dates based on start and end date.</p>
  <p>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.</p>
  <p>I've tried using between, changing the variables to dates using to_date(), nothing worked.</p>
  <pre><code>SET DATE_START_RANGE = '2018-12-1';
  
  SET DATE_END_RANGE = CASE 
                      WHEN CURRENT_DATE = LAST_DAY(CURRENT_DATE) THEN CURRENT_DATE
                      ELSE LAST_DAY(DATEADD(MONTH,-1, CURRENT_DATE))
                      END;
                     
  
  
  SELECT DATES
  --,$DATE_START_RANGE
  --,$DATE_END_RANGE
  FROM (
        SELECT DATEADD(MONTH, ROW_NUMBER() OVER (ORDER BY NULL), '2018-11-01') :: DATE AS DATES
        FROM TABLE(GENERATOR(ROWCOUNT =&gt; 100000)) 
        WHERE 1 =1 
        
       ) LIST_OF_DATES
  WHERE 1 = 1
  AND DATES &gt;= $DATE_START_RANGE  -- this filter is not being picked up
  AND DATES &lt;= $DATE_END_RANGE  -- this filter is not being picked up
  --AND DATES BETWEEN $DATE_START_RANGE AND  $DATE_END_RANGE  -- this filter is not being picked up
  AND DATES LIKE '____-06-%' OR DATES LIKE '____-12-%' 
  
  </code></pre>
  <p>Any ideas?</p>