Access语法中的SQL查询

时间:2014-07-25 22:37:17

标签: sql ms-access

我正在尝试将此查询转换为Access:我遇到的主要挑战是Count列 - 它给出了错误:表达式“Count .....”中的语法错误(缺少运算符) 您会注意到查询中已有的一些更改 - 但Count表达式正在杀死我。

SELECT TblFacility.StrFacilityName,
       TblActivityGroup.GroupID,
       TblActivityGroup.StrGroupName,
       Count(TblClientActivities.ClientID) Over(
          Partition By tblFacility.StrFacilityName, 
                       TblActivityGroup.GroupID, 
                       TblActivityGroup.strGroupName 
          Order By tblFacility.StrFacilityName, 
                   TblActivityGroup.GroupID
      ) AS CountOfClientID
  FROM TblFacility
 INNER JOIN TblActivityGroup
 INNER JOIN TblClientActivities
    ON TblActivityGroup.GroupID = TblClientActivities.lngActivityGroup
   and TblFacility.StrFacilityID = TblClientActivities.lngLocation
 Where TblClientActivities.DtmDate Between Now() And
       DateAdd('m', -3, Now());

任何帮助都将不胜感激。

由于 斯科特

0 个答案:

没有答案