title: Only fetch records with in date range
body: <p><a href="https://i.stack.imgur.com/ZnBy6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZnBy6.png" alt="enter image description here"></a></p>
  
  <p>I have created below query :</p>
  
  <pre><code>SELECT 
  UserID, Username,FirstName, LastName, SUM(CAST(Pass as SIGNED)) Pass,
   SUM(CAST(Fail as SIGNED)) Fail,SUM(CAST(Others as SIGNED))  Others, 
  CAST(SUM(Pass+Fail+Others) as SIGNED)  TotalExecutions, CreatedDate 
  FROM 
  ( 
      SELECT tbl_users.UserID, tbl_users.Username, tbl_users.FirstName, tbl_users.LastName, tbl_executionaudit.CreatedDate, 
      CASE WHEN tbl_executionaudit.Status ='5' THEN count(*) ELSE '' END as `Pass`, 
      CASE WHEN tbl_executionaudit.Status = '6' THEN count(*) ELSE '' END as `Fail`, 
      CASE WHEN tbl_executionaudit.Status !='5' and tbl_executionaudit.Status !='6'  THEN count(*) ELSE '' END as `Others` 
      FROM tbl_users 
      INNER JOIN tbl_useraccounts on tbl_users.UserID=tbl_useraccounts.UserID  
      INNER JOIN tbl_executionaudit on tbl_executionaudit.UserAccountID=tbl_useraccounts.UserAccountID 
      WHERE DATE(tbl_executionaudit.CreatedDate) BETWEEN '2019-06-15' AND '2019-08-30' or tbl_executionaudit.Status in(3,4,5,6,7,8) 
      GROUP by tbl_users.UserID, tbl_users.Username, tbl_executionaudit.Status, tbl_executionaudit.CreatedDate
  ) subquery 
  GROUP BY UserID, Username
  </code></pre>
  
  <p>Query link : <a href="https://drive.google.com/file/d/1b3a2Gpz36vOOiNz0Lvnw-0La1cs0z-Ly/view" rel="nofollow noreferrer">external link to GDrive</a></p>
  
  <p>I want to fetch from BETWEEN '2019-06-15' AND '2019-08-30' .</p>