numbering by unique

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

    #1

    numbering by unique

    Hello.
    I have table that has this type of data except for column "location"

    location ID Cnum Company Address
    1 1 10123 ABC Inc. California
    1 2 10124 Big Company Nevada
    1 3 10125 Company C Minnesota
    2 4 10125 Company C New York
    3 5 10125 Company C Georgia
    1 6 10126 Distant Company London

    ID is autonumber field and primary key.
    I need to figure out a way to create the location column entries on existing
    data and for every new record added.
    The location is a number so that each location for the companies has a unique
    id number.
    i.e. when there is only one location, it's location number is 1...when there
    is more than one location for a company, the location is a number starting at
    1 and incrementing for each location for that company.

    There are 12000 records in this table and about 9000 unique companies...so I
    don't want to create a table for each company.
    Any ideas how I can do this? Thanks
Working...