Create a result for a line chart with dates I have this table in SQLite which I use to record the risk level identified in vulnerability assesments according to the day the scan was performed. 
This table looks like this: 

Scan Date  | Risk
2014-04-20 | 26  
2014-04-24 |  60  
2014-04-26 | 156  
2014-04-28 |  26  


What I want to do is  to build a table like the following in order to use it to display the results on a line graph day by day (including those days without scanning, where the risk level is the same as the last scanning):

  Date    | Risk 
2014-04-20|  26  
2014-04-21|  26  
2014-04-22|  26  
2014-04-23|  26  
2014-04-24|  60  
2014-04-25|  60  
2014-04-26| 156  
2014-04-27| 156  
2014-04-28|  26 


How can I do it using SQL?
It's not pretty but if you have a calendar table (there are plenty of scripts online to create one), you can run the following. I joined calendar to your table and replaced the NULL's (which in your case would not have a scan date) with the last risk number.

Here's a SQL Fiddle

select caldate, scandate,
(select risk from yourTable where scandate = (select max(scandate) from yourTable where 
  scandate is not null and scandate &lt;= caldate)) 
from calendar a
left join yourTable b on a.caldate = b.ScanDate
where caldate between '2014-04-20' and '2014-04-28'