title: Multiple argument IF statement - T-SQL
body: <p>How do I write an IF statement with multiple arguments in T-SQL?</p>
  
  <p>Current source error:</p>
  
  <pre><code>DECLARE @StartDate AS DATETIME
  DECLARE @EndDate AS DATETIME
  
  SET @StartDate = NULL
  SET @EndDate = NULL
  
  IF (@StartDate IS NOT NULL AND @EndDate IS NOT NULL) 
      BEGIN
          -- do some work
      END
  </code></pre>
  
  <p>It throws the following error:</p>
  
  <blockquote>
    <p>Incorrect syntax near the keyword
    'AND'. Incorrect syntax near the
    keyword 'AND'. Incorrect syntax near
    ')'.</p>
  </blockquote>