Quantcast
Channel: SQL Server Reporting Services, Power View forum
Viewing all articles
Browse latest Browse all 10045

Filtering by Date (DateDiff)

$
0
0

Hi 

I'm using SSRS 2008

I have a dataset with computer info and dates of how up-to-date the client is. The ClientDate is in formation dd/mm/yy, there are some values that come back as "Unknown" so I have to account for this. I want to only report on clients that are older than 7 days. 

I've tried filtering the dataset using Datediff using this :

=IIF(ISDate(Fields!Virus_Definition___Date.Value)=False,1,IIF((DateDiff("d",CDate(Fields!Virus_Definition___Date.Value),now()) >6),0,1) )

Set the compare to be = and the value to be =1

But I get the following error : An error has occurred during report processing, Failed to evaluate the FilterExpression of the Dataset 'DataSet1'.

If I just use this on it's own then it shows all 'Unknown' Values without a problem.  

=IIF(ISDate(Fields!Virus_Definition___Date.Value)=False,1,0)

If I remove all filtering and put the datediff command in the table as a column it works perfectly and returns the ages of the client :

Ie.

Computer 1          06/06/2014     3



Viewing all articles
Browse latest Browse all 10045

Trending Articles