Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2006

    Unanswered: Calculated field Query syntax

    I have a query that I would like to have a calculated field called GROUP whose values are based on another field. For Example, if field CODE1 = A, B, or C then GROUP = "First". If field CODE1 = C or D or F, then the GROUP = "second" and so on. This would apply for each record to assign which group they would be in.

    I only have four groups and I am pulling data from a mainframe report. The query seems to be the most direct since I am cutting and pasting the info into a spreadsheet for mgt to view however they wish. Any help with syntax appreciated

  2. #2
    Join Date
    Mar 2003
    The Bottom of The Barrel
    Provided Answers: 1
    Use a lookup table.


    Sample data:

    code | group
    A First
    B First
    C First
    D Second
    E Second
    F Second


    SELECT t1.code,
    FROM yourTable t1 INNER JOIN tblCodeGroup t2 on t1.code = t2.code
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts