Query help

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mom2B

    #1

    Query help

    I have a query where I want to retrieve
    "YES" if tableName.repla cement = 1 and
    "NO" if tableName.repla cement = 0 and
    "DONT KNOW" if tableName.repla cement = 2.

    How do I do this in SQL? I know in ORACLE SQL*PLUS I would use the decode
    function. Is there something similar in Access?


  • Peter Russell

    #2
    Re: Query help

    There is no SQL statement to do this (AFAIK).
    But in VBA you have Choose (which works to base 1).

    MyChoice = Choose(tableNam e.replacement+1 , "No", "Yes", "Don't Know")

    Regards

    Peter Russell

    Mom2B previously wrote:
    [color=blue]
    > I have a query where I want to retrieve
    > "YES" if tableName.repla cement = 1 and
    > "NO" if tableName.repla cement = 0 and
    > "DONT KNOW" if tableName.repla cement = 2.
    >
    > How do I do this in SQL? I know in ORACLE SQL*PLUS I would use the
    > decode
    > function. Is there something similar in Access?
    >
    >
    >[/color]

    Comment

    Working...