Friday, March 9, 2012

How to use iif in Filter expression

I am want to do a count distinct of an ID where fieldInt is not null in a table. This is how I am doing it... In Layout view, click the table, then right click Properties on Filters tab, for filter I do the following:

In Expression column: = Fields.fieldInt.Value

In Operator column: = !=

In Value: 'null'

But this is not working. How do I solve this problem.

try this.

IsDBNull(Fields.fieldInt.Value ) = false

|||

You can write this in the expression

= iif( Fields.Fieldint.value is nothing, 0, CountDistinct(Fields.Fieldint.value))

This should get you your count distinct where values are not null.

Hammer

No comments:

Post a Comment