Skip to content
Aaron Gong edited this page May 15, 2016 · 2 revisions

SQL for obtaining daily closed sales (add your limits for start and end date)

SELECT DATE(`dt`) as mydate, SUM(`total`) AS mysales FROM `sales` WHERE `status` = '1' GROUP BY mydate ORDER BY `dt`

Status Codes

  • 0 = open
  • 1 = completed
  • 2 = refund
  • 3 = void
Clone this wiki locally