title: Get previous month data in Azure Cosmos DB
body: <p>Hi I am trying to get previous 4 month records from azure cosmos db.</p>
  
  <pre><code>SELECT * FROM c where c.userid = '100' and c.Date &lt; GetCurrentDateTime()
  </code></pre>
  
  <p>This gives all the records from current datetime</p>
  
  <p>I have one other date field called preDate. Now i want to get the records which are less than 4 months from this preDate something like:</p>
  
  <pre><code> SELECT * FROM c where c.userid = '100' and c.Date &gt; (c.preDate - 4 months)
  </code></pre>
  
  <p>is there anything equivalent like DATEADD() for CosmosDB
  some thing a query like</p>
  
  <pre><code>SELECT * FROM TABLE_NAME WHERE Date_Column &gt;= DATEADD(MONTH, -4, GETDATE()) 
  </code></pre>