Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Analysis Server and Reporting Services (2008)
 Return data less than day(s)

Author  Topic 

sz1
Aged Yak Warrior

555 Posts

Posted - 2012-12-18 : 09:52:04
Hi

Is someone good with expressions, calculating - days?
I'm trying to return the percentage of calls minus 1 day from todays date, so using the ClosedDate field to query against if any tickets is today dont calculate only previous days where ClosedDate field is stamped.

Here's what I have...the first part works ou first if Number Of Days is less than 3 days and if so devides all calls to get average. I just dont want to include todays calls...


=Sum(IIF(Fields!NUMBER_OF_DAYS.Value < 3,1,0) and Fields!ClosedDate.Value <= DateAdd("d",-1, GetDate()),"DataSet1")
/Count(Fields!NUMBER_OF_DAYS.Value, "DataSet1")

sz1
Aged Yak Warrior

555 Posts

Posted - 2012-12-18 : 10:00:54
Ok sorted it with this:

=Sum(IIF(Fields!NUMBER_OF_DAYS.Value < 3,1,0) and Fields!ClosedDate_DT.Value <= DateAdd("d",-1, TODAY()),"DataSet1")
/Count(Fields!NUMBER_OF_DAYS.Value, "DataSet1")

Thanks
Go to Top of Page
   

- Advertisement -