Counting Occurrences in Multiple Fields

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • behlin
    New Member
    • Nov 2011
    • 2

    #1

    Counting Occurrences in Multiple Fields

    I am using Access 2007.I have a table that contains 14 ink fields. The ink colors could occur in any of the fields but only once per record. I need to calculate the number of occurance for each individual ink color that appears in the table.

    ink1 ink2 ink3 ink4 ink5 ....... ink14
    red blk purp Yellow blue
    WH Bl Yellow purp red
    blk wh bl red purp

    Any one have any ideas?
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    First, that's poor design and you may want to think about a redesign if possible.

    Second, you can achieve what you want by unioning all the ink fields and then doing your count query on that.

    Comment

    • NeoPa
      Recognized Expert Moderator MVP
      • Oct 2006
      • 32669

      #3
      I agree. A perfect illustration of why Normalised data is necessary in database design. See Database Normalisation and Table structures.

      Comment

      Working...