Hello the below query gives the following output :
Sales RestaurantID Date
100.00 1 2016-01-01
200.00 1 2016-01-02
300.00 1 2016-01-03
Instead of that i need to convert the Date values to columns and show total sales under each day so the output should be like this
RestaurantID 2016-01-01 2016-01-02 2016-01-03
1 100.00 200.00 300.00
Query
select sum(Sales),RestaurantID, dateadd(DAY,0, datediff(day,0, Date)) as Date
from DailySales
group by dateadd(DAY,0, datediff(day,0, Date)),RestaurantID