I have a table: Hourly_Sales that is like this (counting how many buy something and the ID check):
Store Time Year Month Count_Service Count_Service_ID_Check
00001 09:00 2011 8 40 3
00001 10:00 2011 8 50 5
00001 15:00 2011 8 50 5
Now I want to be able to display it like this in Reporting Services:
09:00 10:00 11:00 12:00 13:00 14:00 15:00
Store: 00001
Count_Service 40 50 0 0 0 0 50
Count_Service_ID_Check 3 5 0 0 0 0 5
That is I want to add the hours where there are no transactions, and add a 0.
I have a time table: Dim_TimeTable
That is populated with time and store id:
Store Time
00001 09:00
00001 10:00
00001 11:00
00001 12:00
00001 13:00
00001 14:00
00001 15:00
Shouldn´t it be enough to do a LEFT JOIN on the Hourly_Sales?
I found a simular question but couldn´t get the answer for my problem for it:
SQL Query to return 24 hour, hourly count even when no values exist?
Thanks for any help!
Yes – use:
as your query, then use a matrix to display time across the page.