At work I am having a production overview board which is showing the parts produced per hour since midnight. It is organized as a table for each line we are running.
As you can see from the image it uses different colors to represent wether the goal has been achieved or not. Also another 3 colors are used to display planned events such as Planned Downtime, Planned Maintenance work, Planned Changeover. The screen is being populated from an SQL DB and to display the planned events in colors another SQL table is used. Its structure is likeDepending on the event different integer is used to populate the columns from 00 to 23. E.g. if we have planned downtime the number will be 1, planned DT will be 2 and etc. and that will colour the specified cell in picture 1.
I would like to ask if there is way to get 2 dates e.g. start date & end date and populate the hour columns which are within the date/time period? In other words I could not find the SQL query that could let me do it.