Process Records In A Table In Groups

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

    Process Records In A Table In Groups

    I have a table of about 10,000 records where each record has a numeric field
    named RecIdent. The value of RecIdent starts at 1 and is not sequential. For a
    given RecIdent, there may be only one record with that value or there could be
    multiple records with the same value. A sample of records looks like:

    PK RecIdent
    1 1
    2 3
    3 3
    4 5
    5 6
    6 6
    7 6
    8 6
    9 11
    10 17
    11 17

    Starting at RecIdent 1, I need to process all the records with the same RecIdent
    as a group then move to the next value of RecIdent and process all records with
    that RecIdent as a group. In the above example, I would process 1 record in the
    first group with RecIdent 1, 2 records in the next group with RecIdent 3, 1
    record in the next group with RecIdent 5, 4 records in the next group with
    RecIdent 6, etc. I need to do this until I have processed all the records in the
    table.

    I'm looking for help on how to loop through the RecIdent field, pick the groups
    of records with the same RecIdent, process those records and then go to the next
    group of records and process those records until I have processed all the
    records in the table. It seems like it takes a For/Next loop but I don't know
    how to set it up.

    Thanks for an help anyone can give!

    Liz


  • Bas Cost Budde

    #2
    Re: Process Records In A Table In Groups

    Liz wrote:
    [color=blue]
    > Starting at RecIdent 1, I need to process all the records with the same RecIdent
    > as a group then move to the next value of RecIdent and process all records with
    > that RecIdent as a group.[/color]

    What process?

    I don't mean to hamper you, but maybe you are trying to solve something
    procedurally that can be solved using SQL.
    --
    Bas Cost Budde

    but the domain is nl

    Comment

    Working...