I need to find fast way to sampling constantly time gap of specific range

In my project, I need show about 6 months amount of time series graph in .net.
Here is task what I want for.


When I use MSSQL,Sampling result coming out when inner join data table with sampling time table(what I want to select).
But, I didn’t find that way to get sampled data.
Someone has idea?