How to apply only OR filter opertor on more than one columns

  • Hello How are all here ...

    I want to write a filter expression by using only OR logical operator between two columns:

    1. Age and Position are the two columns.

    2. I want to write an expression such like:

    Age >= 19 OR Position = "Mother" OR Position ="Father" (This is an Sql filter expression)

    How can I write such expression ?

    Currently I am trying to write this expression as below:

    =IIF(cstr(Fields!AGE.Value) >= 19 OR cstr(Fields!Position.Value) = "Mother","false","true") And Value = 0, but still it is returning all records which are less than 19 as well as non-mother.

    Please help?

  • What is it you want returned?

    >=19, True

    Mother, True

    Father, True

    All others false?

    If this is what you want, try this:

    =IIF(cstr(Fields!AGE.Value) >= 19,"true",IIF(cstr(Fields!Position.Value) = "Mother","true",IIF(cstr(Fields!Position.Value) = "Father","true","false")))

  • I have already resolved it. It was very simple. Thanks by the way.

  • azhar rahi (1/10/2011)


    I have already resolved it. It was very simple. Thanks by the way.

    How did you resolve it?

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply