List all dates in a 2015 and 2016

List all dates in a 2015 and 2016

  
Hello experts

I am really struggling with a issue. I have to generate a list of all dates in 2015 and 2016 , so I can compare the date in a table like below which has the dates from 2015 and 2016.

With all the dates from 2015 and 2016 I need to perform a left join with the above table so I can get the rest of the dates in both the year.
Can anybody suggest me how ca I approach this.
I tried to create a new table called Year2015 and tried to use the below code. But it throws the error.Any help is greatly appreciated.Please

select {Year2015}.[selected_date],
       IF({SnapshotDate}.[IsAvailable] IS NULL, FALSE, TRUE) as {SnapshotDate}
from 
     (select adddate('2015-01-01', t2.i*100 + t1.i*10 + t0.i) selected_date 
      from
         (select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t0,
         (select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t1,
         (select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t2
     ) {Year2015}
LEFT JOIN {SnapshotDate}
       ON {Year2015}.[selected_date] = {SnapshotDate}.[IsAvailable]   
where {Year2015}.[selected_date] < '2016-01-01'
Hi v,

Why are you double posting? And why are you creating such outlandish Advanced Queries? I already gave you a solution in your other post.