我想從三個使用Microsoft Access中的內連接的表中進行選擇。在其中一個字段中,我還需要選擇它返回的記錄數。內置函數和分組在Microsoft Access中不起作用
SELECT Person.FirstName, Person.LastName, Person.Phone,
Person.Email,Person.Address, Room.RoomNo, Room.Type, Building.Name,
Floor.Name,count(*) as result
FROM (Floor INNER JOIN (Building INNER JOIN
Room ON Building.BuildingID = Room.BuildingID) ON Floor.FloorNo =
Room.FloorNo) INNER JOIN (Person INNER JOIN Patient ON Person.Username =
Patient.Username) ON Room.RoomNo = Patient.RoomNo
WHERE (((Person.FirstName) Like "*" & [Forms]![search]![firstnameKey] & "*")
AND ((Person.LastName) Like "*" & [Forms]![search]![lastnameKey] & "*")) AND
(patient.status = 1)
GROUP BY Patient.username ;
什麼錯誤信息你好嗎? – hypetech
@hypetech你的查詢不包括指定的表達式'名字'作爲聚合函數的一部分 –