I have a sales table and it contains sales figure by different store along with timing, let's say in one day and one of store we have done 10,000 transactions then I need to find the total sales for every 15 min for that particular business date, keeping in mind for example: if there's no sales between 12:00 PM to 12:15 PM then it should be zero as a value or null.
In a day we have 24 hours so it means 96 columns for the 15 min interval.
Sales Table:
SiteName Time Amount BusinessDate
----------------------------------------------------------
A 7:01:02 AM 20 2017-01-02
A 7:03:22 AM 25 2017-01-02
A 7:05:03 AM 33 2017-01-02
A 7:11:02 AM 55 2017-01-02
A 7:13:05 AM 46 2017-01-02
A 7:17:02 AM 21 2017-01-02
A 8:01:52 AM 18 2017-01-02
A 8:55:42 AM 7 2017-01-02
A 8:56:33 AM 7 2017-01-02
A 8:58:55 AM 31 2017-01-02
and so on
How can I accomplish this?!