title: How to subtract date from current date in SQL?
body: <p>I am writing some test cases and for that I need to subtract 7 days and 30 days from the current date. I am using getDate() function to get the current date. I am not exactly sure how to achieve this? </p>
  
  <p>Below is my query and for the transaction id 14867 I need to update the date column to go back to 7 days and similarly I will write another query to subtract 30 days from the current date. </p>
  
  <pre><code>UPDATE ESG.DOC_TRAN
      SET DOCUMENT_TRANSACTION.CREATED_DATE = getDate()
      WHERE DOCUMENT_ID = 14867;
  </code></pre>
  
  <p>Thanks</p>