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

I need an expression to return multiple results

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

  1. Lori

    Lori
    Expand Collapse
    Guest

    I've tried a varity of possibilities. I'm trying to write an expression that
    will return different answers based on the results in a given field. the
    FINAL: IIf([TOTAL]>"84","4") works perfectly but I'm looking for a way to get
    the answer to come up with <"65",1, between 65 and 74, 2 and between 75 and
    84, 3.

    Can anyone help???
    --
    Lori A. Pong
     
  2. Loading...

    Similar Threads Forum Date
    Sikh News WWI Sikh Heroes Need To Be Remembered: Dr Atamjit Breaking News Sep 11, 2016
    Interracial And Interfaith Marriage, Help Needed To Confront/convince My Parents Love & Marriage Aug 16, 2016
    Sikh News Sikh Seva Volunteers Keep The Food Service Drive For The Needy Going After Passing Away Of Breaking News Jul 29, 2016
    Need some info regarding bibek wrt eating Sikh Rehat Maryada Jan 14, 2016
    Spiritual Why We Only Need To Pray For Naam Blogs Dec 20, 2015

  3. Douglas J Steele

    Douglas J Steele
    Expand Collapse
    Guest

    FINAL: IIf([TOTAL] < "65", "1", IIf([TOTAL] <= "74", "2", IIf([TOTAL] <=
    "84","3", "4")))

    or

    FINAL: Switch([TOTAL] < "65", "1", [TOTAL] >= "65" And [TOTAL] <= "74", "2",
    [TOTAL] > "74" And [TOTAL] <= "84", "3", [TOTAL] > "84", "4)

    On the other hand, from the name, I would expect [TOTAL] to be a numeric
    field, not text, in which case you don't want the quotes around the values.

    --
    Doug Steele, Microsoft Access MVP
    http://I.Am/DougSteele
    (no e-mails, please!)


    "Lori" <Lori@discussions.microsoft.com> wrote in message
    news:CC88952F-2BCF-496C-BF32-D47C5D389555@microsoft.com...
    > I've tried a varity of possibilities. I'm trying to write an expression

    that
    > will return different answers based on the results in a given field. the
    > FINAL: IIf([TOTAL]>"84","4") works perfectly but I'm looking for a way to

    get
    > the answer to come up with <"65",1, between 65 and 74, 2 and between 75

    and
    > 84, 3.
    >
    > Can anyone help???
    > --
    > Lori A. Pong
     
  4. Lori

    Lori
    Expand Collapse
    Guest

    Thanks, your a life saver. It worked perfect!
    --
    Lori A. Pong


    "Douglas J Steele" wrote:

    > FINAL: IIf([TOTAL] < "65", "1", IIf([TOTAL] <= "74", "2", IIf([TOTAL] <=
    > "84","3", "4")))
    >
    > or
    >
    > FINAL: Switch([TOTAL] < "65", "1", [TOTAL] >= "65" And [TOTAL] <= "74", "2",
    > [TOTAL] > "74" And [TOTAL] <= "84", "3", [TOTAL] > "84", "4)
    >
    > On the other hand, from the name, I would expect [TOTAL] to be a numeric
    > field, not text, in which case you don't want the quotes around the values.
    >
    > --
    > Doug Steele, Microsoft Access MVP
    > http://I.Am/DougSteele
    > (no e-mails, please!)
    >
    >
    > "Lori" <Lori@discussions.microsoft.com> wrote in message
    > news:CC88952F-2BCF-496C-BF32-D47C5D389555@microsoft.com...
    > > I've tried a varity of possibilities. I'm trying to write an expression

    > that
    > > will return different answers based on the results in a given field. the
    > > FINAL: IIf([TOTAL]>"84","4") works perfectly but I'm looking for a way to

    > get
    > > the answer to come up with <"65",1, between 65 and 74, 2 and between 75

    > and
    > > 84, 3.
    > >
    > > Can anyone help???
    > > --
    > > Lori A. Pong

    >
    >
    >
     
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