Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!
  1.   Become a Supporter    ::   Make a Contribution   
    Target (Recurring Monthly): $200 :: Achieved: $98

problem with criteria

Discussion in 'Information Technology' started by Nathan, Jul 28, 2006.

  1. Nathan

    Nathan
    Expand Collapse
    Guest

    I want to use an iif statement in the criteria for a query, but when "false"
    I would like it to display all records.
    Something like this is what makes sense to me.

    iif(x>y,x,like *)

    where it would filter to the value x when true, but would return all records
    when false.

    This does not work for me, at least with the number fields I'm trying to
    work with. Nor does "x or y or z" despite that exact text working outside of
    an iif statement. Is there a way to do this?

    Thanks Nathan
     
  2. Loading...

    Similar Threads Forum Date
    Sikh News Sikhs Face Problems While Carrying Kirpans In Khyber-Pakhtunkhwa - SikhSiyasat.Net Breaking News Jul 29, 2016
    "Dasam" Granth - A Look At The Core Problems Dasam Granth Oct 21, 2015
    Problems In Life Sikh Sikhi Sikhism Apr 13, 2015
    How can I make decent and useful friends and from where ?? most people have a problem with me Sikh Youth Oct 23, 2013
    The Problem with Taking Too Many Vitamins Health & Nutrition Oct 18, 2013

  3. OP
    KARL DEWEY

    KARL DEWEY
    Expand Collapse
    Guest

    Try this --
    Like iif(x>y,x, "*")

    "Nathan" wrote:

    > I want to use an iif statement in the criteria for a query, but when "false"
    > I would like it to display all records.
    > Something like this is what makes sense to me.
    >
    > iif(x>y,x,like *)
    >
    > where it would filter to the value x when true, but would return all records
    > when false.
    >
    > This does not work for me, at least with the number fields I'm trying to
    > work with. Nor does "x or y or z" despite that exact text working outside of
    > an iif statement. Is there a way to do this?
    >
    > Thanks Nathan
    >
    >
     
  4. OP
    Wolfgang Kais

    Wolfgang Kais
    Expand Collapse
    Guest

    Hello Nathan.

    Nathan wrote:
    > I want to use an iif statement in the criteria for a query, but when
    > "false" I would like it to display all records.
    > Something like this is what makes sense to me.
    >
    > iif(x>y,x,like *)
    >
    > where it would filter to the value x when true, but would return all
    > records when false.
    >
    > This does not work for me, at least with the number fields I'm
    > trying to work with. Nor does "x or y or z" despite that exact text
    > working outside of an iif statement. Is there a way to do this?


    Sure. Your criteria can be translated to a logical expression without
    the iif function (let's say your column is named c): c = x or x <= y.
    Maybe this helps in building the criteria.

    When "x or y or z" is displayed as criterion for the column c in query
    design view, it means "c = x or c=y or c=z". When used elsewhere, for
    example as an argument of the iif function, "x or y or z" evaluates to
    true if at least one of x, y and z is true, regardless of column c.

    --
    Regards,
    Wolfgang
     
Since you're here... we have a small favor to ask...

More people are visiting & reading SPN than ever but far fewer are paying to sustain it. Advertising revenues across the online media have fallen fast. So you can see why we need to ask for your help. Donating to SPN's is vote for free speech, for diversity of opinions, for the right of the people to stand up to religious bigotry. Without any affiliation to any organization, this constant struggle takes a lot of hard work to sustain as we entirely depend on the contributions of our esteemed writers/readers. We do it because we believe our perspective matters – because it might well be your perspective, too... Fund our efforts and together we can keep the world informed about the real Sikh Sikhi Sikhism. If everyone who writes or reads our content, who likes it, helps us to pay for it, our future would be much more secure. Every Contribution Matters, Contribute Generously!

    Become a Supporter      ::     Make a Contribution     



Share This Page