The instance of packet statistics in Access is collected from: http: //expert.9cbs.net/expert/topic/2727/2727523.xml? Temp = .1140711 Online table list: Description: User name version is registered Field: USR_Name Ver IsReg's list: AAA CN TRUE BBB CN FALSE CCC en True DDD fr True results Requirements: Query each version of registered users and unregistered users, draw the following structure: version registration number is not registered CN 1 1 EN 1 0 fr 1 0 Ask the SQL statement in the Access 2000 environment, the SQL statement is finally resolved: 1. MS SQL Server 2000 in the MS SQL Server 2000: SELECT VER AS version, SUM (Case When IsReg = TRUE THEN 1 ELSE 0 END) AS Registration Quantity, SUM (Case When IsReg = FALSE THEN 1 ELSE 0 END) AS Unregistered Quantity from ONLINE GROUP BY version 2. Access 2000 Test Pass: SELECT DISTINCT VER AS version, (Select Count (*) from Online WHERE VER = m.ver and isreg = true) AS registration quantity, (Select Count (*) from online where ver = m.ver and isreg = false) AS unregistered quantity from online as m