I have the following Oracle SQL query results:
TDATE OPEN Closed
19/05/15 1 1
20/05/15 0 1
26/05/15 2 0
27/05/15 1 0
28/05/15 2 0
For example I would like to query from the 19 - 30 May.
And the results i would like to get is:
TDATE OPEN Closed
19/05/15 1 1
20/05/15 0 1
21/05/15 0 0
22/05/15 0 0
23/05/15 0 0
24/05/15 0 0
25/05/15 0 0
26/05/15 2 0
27/05/15 1 0
28/05/15 2 0
29/05/15 0 0
30/05/15 0 0
Where the query is within the date range and records that do not exist will be returned as 0 and 0 for Open and Closed.
Any help would be appreciated.
An empty table with zeroes and all the dates could be made as
Then you can load your results into this table, or combine them otherwise. The placeholder
firstdat
should be a date for the addition to work.