Click here to monitor SSC
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

Help with FilterExpression in BIDS 2005 - I'm going crazy Expand / Collapse
Posted Thursday, February 21, 2013 1:58 PM


Group: General Forum Members
Last Login: Monday, July 4, 2016 4:05 PM
Points: 12, Visits: 180
Hi all,

I hope someone can help. I'm about to pull my hair out. Something as simple as a filter expression in BIDS 2005 is not working.

All I want to do is show results where two numbers divided together are >= .01. I'm getting a "failed to evaluate filter expression" error.

The two numbers from the dataset are from a Stored Proc, where the columns are [money] datatype.

-- First I tried this in the Filter Expression (on a table):
Expression: =(Fields!Collected.Value/Fields!Discounted.Value)

Operator: >=

Value: =.01

When I do it this way, I get the message "Cannot compare date of types System.Decimal and System.Double.

-- So, I changed it to this, in an attempt to force the datatypes to be the same:

Expression: =(CDec(Fields!Collected.Value)/CDec(Fields!Discounted.Value))

Operator: >=

Value: =CDec(.01)

Now I get the error "Failed to evaluate FilterExpression."

This is driving me insane. I'm trying to keep the number of stored procedures (SP) down to a minimum. The same SP is used for other reports which need the same data presented a bit differently in the report definition. All I want to do is filter the results shown. I don't want to create yet another SP to maintain just to get around a crazy, practically unusable filter setting in BIDS. (sorry - just so frustrated right now)

Can anyone help please?? Thanks!!
Post #1422783
Posted Tuesday, March 5, 2013 5:45 PM

Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Sunday, November 20, 2016 8:55 PM
Points: 559, Visits: 994
How about
Expression: =CDec(Fields!Collected.Value/Fields!Discounted.Value)

Value: =0.01

I suspect that dividing two decimals is giving you a float datatype, so convert them to decimal after the division.
Post #1427095
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse