Debug environment: The structure of Access 2000 table A is as follows: ID username1 a3 c.................................... The record 2 records (ID ascending) .Select ID from (IIF (A.ID> = B.ID, 1, 0)) AS Num from Table A As A , Table A as b group by a.id) WHERE NUM = 2 Question 2: Known ID number 3, derived its location in the database (as in ID ascending) Select Count (ID) from FROM table a where id <= 3