Welcome to SPN

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

Sign Up Now!

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

    >
    >
    >
     

Share This Page