Generate a list of dates within the range required and join that with your table using the ISNULL function to derive your default value.
For example I created some simple sample data like this
CREATE TABLE CP5
(
aDate date,
aValue int
)
insert into CP5 values(getdate() - 1,1)
insert into CP5 values(getdate() - 2,2)
insert into CP5 values(getdate() - 3,3)
insert into CP5 values(getdate() - 5,5)
insert into CP5 values(getdate() - 6,7)
Set up my start/end dates as follows
DECLARE @startdate date
SET @startdate = getdate() - 7
DECLARE @enddate date
SET @enddate = getdate();
I can now use this query to get all of the dates in the range with either a value from the table or 0
WITH q AS
(
SELECT @startdate AS datum
UNION ALL
SELECT DATEADD(dd, 1, datum)
FROM q WHERE DATEADD(dd, 1, datum) < @enddate
)
SELECT datum, ISNULL(aValue, 0) as aValue
FROM q
LEFT OUTER JOIN CP5 ON q.datum = CP5.aDate
Gives me these results
2015-02-24 0
2015-02-25 7
2015-02-26 5
2015-02-27 0
2015-02-28 3
2015-03-01 2
2015-03-02 1
The idea for the CTE was adapted from the Tip
Generating a Sequence in SQL[
^] by Manas Bhardwaj (My name also appears next to that tip but I can't take credit for the date sequence bit at all)