Results 1 to 2 of 2
  1. #1
    5 Star Lounger
    Join Date
    Jan 2001
    Thanked 0 Times in 0 Posts

    Count number of 'Y's (2003)

    I am not sure this can be done in a query. I have a query with an indicator fields. I have 7 indicator fields. I would like to create a field that counts the Indicator if it equals Y. What I want is a total count of Ys going across. The new field would be "Total Product Count".

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Thanked 31 Times in 31 Posts

    Re: Count number of 'Y's (2003)

    You can create a calculated field:
    CountY: Abs((Nz([F1],"")="Y")+(Nz([F2],"")="Y")+(Nz([F3],"")="Y")+(Nz([F4],"")="Y")+(Nz([F5],"")="Y")+(Nz([F6],"")="Y")+(Nz([F7],"")="Y"))
    where F1 to F7 are the names of the indicator fields.

    <img src=/S/whisper.gif border=0 alt=whisper width=29 height=17> It would have been better to create a separate table in which each a record is added for each indicator that is true.

Posting Permissions

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