Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
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
Author
Message
Posted Thursday, February 21, 2013 1:58 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Sunday, October 12, 2014 9:02 PM
Points: 10, Visits: 159
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


SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Yesterday @ 5:47 AM
Points: 476, Visits: 879
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