snowal raj

snowal raj

  • NA
  • 166
  • 39.5k

How to get time wise sales report in mysql

Feb 4 2017 1:37 AM
hai,
I need Time Wise Sales Report in mysql,I get the Report like ,
 
Time       Amount
19:00:00       2
20:00:00       3
21:00:00       0
22:00:00       0
23:00:00       9
 
but I need sum the  Amount each time like
 
Time          Amount
19:00:00          2
20:00:00          5
21:00:00          5
22:00:00          5
23:00:00          14
 
 
This is My Query
 
SELECT concat(MID(date_of_call, 12, 2),':00:00') TimeIntervel,COUNT(*) TotalEntries,date_format(date_of_call,'%d/%m/%Y') FROM ICC_MM_setup_suply
WHERE DATE_FORMAT(date_of_call,'%d/%m/%Y')='31/01/2017'
GROUP BY concat(MID(date_of_call, 12, 2),':00:00') 

Answers (3)