title: Date arithmetic within an IN clause in a Teradata SQL query
body: <p>The first two queries here works fine:</p>
  
  <pre><code>SELECT * FROM sys_calendar.calendar
  WHERE calendar_date BETWEEN CAST('2012-06-01' AS DATE) - 365 
                          AND CAST('2013-06-01' AS DATE) - 1;
  
  SELECT * FROM sys_calendar.calendar
  WHERE calendar_date IN ('2012-06-01', '2013-06-03');
  </code></pre>
  
  <p>However, the next two queries throw the error </p>
  
  <blockquote>
    <p>SELECT Failed.  [3706] Syntax error: expected something between ')' and ','.</p>
  </blockquote>
  
  <p>It appears that the <code>CAST</code> is throwing off the IN clause, but I don't understand why. What is going on here?</p>
  
  <pre><code>SELECT * FROM sys_calendar.calendar
  WHERE calendar_date IN (CAST('2012-06-01' AS DATE) 
                        , CAST('2013-06-03' AS DATE));
  
  SELECT * FROM sys_calendar.calendar
  WHERE calendar_date IN (CAST('2012-06-01' AS DATE) - 365
                        , CAST('2013-06-01' AS DATE) - 1);
  </code></pre>