title: Invalid Operation On An ANSI DATETIME (Subtracting one timestamp from another in Teradata)
body: <p>I would like to create a WHERE condition to return results where only 1 day has passed between two timestamps. I tried this:</p>
  
  <pre><code>SELECT * FROM RDMAVWSANDBOX.VwNIMEventFct
  INNER JOIN VwNIMUserDim ON VwNIMUserDim.NIM_USER_ID = VwNIMEventFct.NIM_USER_ID
  INNER JOIN rdmatblsandbox.TmpNIMSalesForceDB ON TmpNIMSalesForceDB.EMAIL = VwNIMUserDim.USER_EMAIL_ADDRESS
  WHERE (CONTRACT_EFFECTIVE_DATE - EVENT_TIMESTAMP) =1
  </code></pre>
  
  <p>But the result was an error message "Invalid Operation On An ANSI DATETIME value".</p>
  
  <p>I guess that, looking at the code now, Teradata has no way of knowing whether the "1" in "= 1" is a day, hour or year.</p>
  
  <p>How would I select data where only 1 day has passed between CONTRACT_EFFECTIVE_DATE and EVENT_TIMESTAMP?</p>
  
  <p>Same again for 2 days, and 3 days etc?</p>