title: IF equals or clause
body: <p>I have a stored procedure that runs two separate queries and puts the data into two temporary tables. I then have an IF statement below that, depending on the outcome will display one of the two tables.</p>
  
  <pre><code>DECLARE @DATASET1 AS FLOAT
  DECLARE @DATASET2 AS FLOAT
  
  SET @DATASET1 = (SELECT SUM(PREM) FROM #Prem1)
  SET @DATASET2 = (SELECT SUM(PREM) FROM #Prem2)
  
  IF (@DATASET1 = 0)
  BEGIN
  
      SELECT  DATE,
              SUM(PREM) AS PREM
      FROM #DATASET2
      GROUP BY YEAR, MONTH, DATE
      ORDER BY YEAR, MONTH
  
  END
  
  IF (@DATASET2 = 0)
  BEGIN
  
      SELECT  DATE,
              SUM(PREM) AS PREM
      FROM #DATASET1 
      GROUP BY YEAR, MONTH, DATE
      ORDER BY YEAR, MONTH
  
  END 
  </code></pre>
  
  <p>This was working well until I hit some output on dataset1 that didn't produce 0 but just produced no data at all.</p>
  
  <p>So I was wondering if it is possible to update this part of the query to almost say:</p>
  
  <pre><code>IF (@DATASET1 = 0 or '')
  </code></pre>
  
  <p>I have tried something like that but doesn't seem to work, hence my question.</p>