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

SQL for obtaining daily completed sales. You can change the date range and also choose to view void / refund / open sales instead of completed sales

SELECT DATE(`dt`) as mydate, SUM(`total`) AS mysales FROM `sales` WHERE `status` = '1' AND DATE(`dt`)>='2016-05-01' AND DATE(`dt`)<='2016-05-31' GROUP BY mydate ORDER BY `dt`

Status Codes

  • 0 = open
  • 1 = completed
  • 2 = refund
  • 3 = void

You may be using it for daily sales reporting to landlord

Clone this wiki locally