SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Values > 0 in Expression


Values > 0 in Expression

Author
Message
sharonsql2013
sharonsql2013
SSCrazy
SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)

Group: General Forum Members
Points: 2062 Visits: 1265
I only want to see all the values in the column which are greater than 0. I don't want to put it in the where clause(Query) because there is a lookup based on that . But want to display in the table only the one's which are > 0.
How can I achieve this?
Rob Taylor
Rob Taylor
SSCertifiable
SSCertifiable (6.4K reputation)SSCertifiable (6.4K reputation)SSCertifiable (6.4K reputation)SSCertifiable (6.4K reputation)SSCertifiable (6.4K reputation)SSCertifiable (6.4K reputation)SSCertifiable (6.4K reputation)SSCertifiable (6.4K reputation)

Group: General Forum Members
Points: 6373 Visits: 1645
sharonsql2013 (2/26/2014)
I only want to see all the values in the column which are greater than 0. I don't want to put it in the where clause(Query) because there is a lookup based on that . But want to display in the table only the one's which are > 0.
How can I achieve this?

Use an expression, give IIF() a look. Something like:

=IIF(Fields!YourColumn.Value > 0, Fields!YourColumn.Value, "")


HTH,
Rob

Edit -- I can't get the > (greater than) sign to display above. Just replace the > with a > sign.
sharonsql2013
sharonsql2013
SSCrazy
SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)

Group: General Forum Members
Points: 2062 Visits: 1265
Thanks.
The Thing is the IIF Clause returns blank row if the value is not meeting the condition. I am looking for it to not to display that row if the condition is not met.
Rob Taylor
Rob Taylor
SSCertifiable
SSCertifiable (6.4K reputation)SSCertifiable (6.4K reputation)SSCertifiable (6.4K reputation)SSCertifiable (6.4K reputation)SSCertifiable (6.4K reputation)SSCertifiable (6.4K reputation)SSCertifiable (6.4K reputation)SSCertifiable (6.4K reputation)

Group: General Forum Members
Points: 6373 Visits: 1645
Try putting that expression in the Visibility for that group. You want the IIF() to evaluate as either True or False (for visible or not).

HTH,
Rob
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum







































































































































































SQLServerCentral


Search