February 21, 2013 at 1:58 pm
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!!
March 5, 2013 at 5:45 pm
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.
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply