• Select every nth record? (2003)

    Author
    Topic
    #447173

    Is there a way to select every nth (say, every 3rd, or 5th, or 8th, etc) record from a table using a query?

    The data are GPS positions, and I am using them to create an animation of vehicle motion. Selecting non-contiguous records allows me to speed up the animation. Presently I select every record in the base query, and then walk thru the resulting recordset using the recordset.MOVE N command in some VBA code. However this technique can miss significant records when more than one vehicle exists in the recordset. I figure that selecting the nth records prior to walking thru the recordset (and then displaying EVERY record from the query) would work better.

    thanks for any help.

    Viewing 0 reply threads
    Author
    Replies
    • #1089374

      If you have a sequential ID, you could use the mod function:

      every_nth:[id] mod 4

      set criteria to 1 to show records 1,5,9 etc

    Viewing 0 reply threads
    Reply To: Select every nth record? (2003)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: