title: SQLite strftime Group By
body: <p>I have a table consisting of a date field and a barcode field; I want the number of barcodes grouped by day for the previous month.</p>
  
  <p>This looked like it would work:</p>
  
  <pre>
  SELECT
  COUNT(*) AS count,
  strftime('%d-%m-%Y',date) AS day
  FROM barcodes
  WHERE date >= datetime('now', '-1 month')
  GROUP BY day
  ORDER BY date ASC;
  </pre>
  
  <p>But that gives me incorrect counts. E.g.:</p>
  
  <pre>
  341|30-01-2017
  274|31-01-2017
  288|01-02-2017
  332|02-02-2017
  224|03-02-2017
  35|04-02-2017
  1009|06-02-2017
  1481|07-02-2017
  1626|08-02-2017
  507|09-02-2017
  428|10-02-2017
  125|11-02-2017
  1838|13-02-2017
  2591|
  </pre>
  
  <p>Whereas:</p>
  
  <pre>
  SELECT COUNT(*) FROM barcodes WHERE date LIKE '2017-02-10%';
  579
  </pre>
  
  <p>If I do this:</p>
  
  <pre>
  SELECT 
  COUNT(*) AS count,
  strftime('%d-%m-%Y',date) AS day
  FROM barcodes
  WHERE date LIKE '2017-02-10%'
  GROUP BY day
  ORDER BY date ASC;
  </pre>
  
  <p>I get:</p>
  
  <pre>
  428|10-02-2017
  151|
  </pre>
  
  <p>So my question is: why is SQLite providing the result as two lines when I use strftime()?</p>