title: How to fetch sequelize js records for today
body: <p>I have a table which looks similar to the below table. I am trying to find the sum of all prices for TODAY.</p>
  
  <pre><code>| id| price |       created        |
  |---|-------|----------------------|
  | 0 |  500  | 2018-04-02 11:40:48  |
  | 1 | 2000  | 2018-04-02 11:40:48  |
  | 2 | 4000  | 2018-07-02 11:40:48  |
  </code></pre>
  
  <p>The below code is what i came up with but it doesn't seem to work.</p>
  
  <pre><code>const TODAY = new Date();
  const SUM = await OrdersModel.sum('price', {
      where: {
        created: TODAY,
      },
  });
  console.log(SUM);
  </code></pre>
  
  <p>Value of SUM is 0 even though there are entries for today. I also tried the following but it too didn't work.</p>
  
  <pre><code>const TODAY = new Date();
  const SUM = await OrdersModel.sum('price', {
      where: {
        created: Sequelize.DATE(TODAY),
      },
  });
  console.log(SUM);
  </code></pre>
  
  <p>The SQL statement queried on the terminal is as follows.</p>
  
  <blockquote>
    <p>Executing (default): SELECT sum(`price`) AS `sum` FROM `orders` AS `orders` WHERE `orders`.`created` = '2019-05-27 18:30:00';</p>
  </blockquote>