How to show the record number in a MS Access report table?

前端 未结 1 1520
青春惊慌失措
青春惊慌失措 2020-12-22 06:40

I\'m using MS Access to make a small piece of software for an office. When we insert a record the record ID does not always follow the sequence of natural numbers, starting

相关标签:
1条回答
  • 2020-12-22 07:11

    I assume your table name is inventory:

    SELECT DCOUNT("[Description]","[inventory]","[Description]<='" & [Description] & "'") AS rank, inventory.*
    FROM inventory
    ORDER BY [Description]
    

    DCOUNT function counts the number of rows that satisfy the a given criteria. In this case we count the number of rows that are less than the current row. Things will work if the column you use has unique values.

    0 讨论(0)
提交回复
热议问题