sql server 2008 - SSRS - Hide Results for future months -


i'm producing line graph within ssrs using sql queries. have line graph 4 datasets (3 using lookup function).

my queries calculate values each month of current year. in june, values of months july december 0. don't want displayed on graph , on axis.

can point me in right direction? i've tried add filter category group axis hasn't worked

expression: month_field operator: < value: =month(today()) 

my sql query build of months year can result months ( having issues returning 0 value month) eg..

(select * (values(datename(month,'2015-01-01'),1)                       ,(datename(month,'2015-02-01'),2)                       ,(datename(month,'2015-03-01'),3)                       ,(datename(month,'2015-04-01'),4)                       ,(datename(month,'2015-05-01'),5)                       ,(datename(month,'2015-06-01'),6)                       ,(datename(month,'2015-07-01'),7)                       ,(datename(month,'2015-08-01'),8)                       ,(datename(month,'2015-09-01'),9)                       ,(datename(month,'2015-10-01'),10)                       ,(datename(month,'2015-11-01'),11)                       ,(datename(month,'2015-12-01'),12)) mnth("  month  ",mnthsort)) m 

followed below returnvalues greater 1st fay of current year , less 1st day of current month

     received1date >=dateadd(mm,datediff(mm,0,getdate())-12,0)and received1date < dateadd(mm,datediff(mm,0,getdate()),0) 

my issue when using query in ssrs on line graph months display on axis , future results 0 - know expected because of query wondering if there can graph within ssrs exclude future months?

why don't filter data in query?

   select values     table     transaction_date >= getdate() 

this way future months not options displayed.


Comments