编辑:简短版本:
在make表查询中尝试使用以下SQL时,我不断收到一个错误,即"操作查询不能用作行源"该查询的哪一部分是动作查询?有没有办法更改查询,以便它可以工作?我相信这可能是由于[计数(资格_申请。[已注册的家庭成员])AS [CountOfAdditional Related People]"部分。
我尝试使用的SQL是:
SELECT Eligibility_Applications.[Application Date], Eligibility_Applications.[Eligibility Rep], Eligibility_Applications.Clinic, Eligibility_Applications.Outreach, Eligibility_Applications.[Content Type], Eligibility_Applications.Renewal, Eligibility_Applications.[Application Status], Count(Eligibility_Applications.[Family Member(s) Enrolled]) AS [CountOfAdditional Related People], Eligibility_Applications.Related_Person_ID, People.[Patient Status], People.[City of Residence], People.SSN, People.[Content Type] AS [Person Type], IIf([SSN]="999999999","Undocumented","Documented") AS Documented INTO tbl_Test
FROM Eligibility_Applications INNER JOIN People ON Eligibility_Applications.Related_Person_ID = People.ID
GROUP BY Eligibility_Applications.[Application Date], Eligibility_Applications.[Eligibility Rep], Eligibility_Applications.Clinic, Eligibility_Applications.Outreach, Eligibility_Applications.[Content Type], Eligibility_Applications.Renewal, Eligibility_Applications.[Application Status], Eligibility_Applications.Related_Person_ID, People.[Patient Status], People.[City of Residence], People.SSN, People.[Content Type], IIf([SSN]="999999999","Undocumented","Documented")
HAVING (((Count(Eligibility_Applications.[Family Member(s) Enrolled]))>0) AND ((Eligibility_Applications.Related_Person_ID) Is Not Null));
详细说明:
我们的组织刚刚将其软件从访问2007更新到2013年(这意味着由于"升级&#34,不再可能使用数据透视表)。我正在尝试使用访问excel的链接信息来解决这个问题。
我有两种查看数据的方法。一个使用简单的选择查询并且可以使用excel解决方法,另一个查询是一个聚合查询,它计算多值字段中的条目数(链接到sharpoint,我无法删除/更改它)。以前这是数据透视表的源,我可以使用strWhere在打开数据透视表时更改源。
不幸的是,如果我想更改发送到excel的记录,我需要先创建一个表(据我所知,因为我认为我不能同时链接excel并动态更改SQL的SQL查询)。问题是,当我尝试将查询更改为Make Table时,它不起作用,说明"操作查询不能用作行源"。有没有办法让我能够创建一个包含多值字段的表(我只需要字段中的条目数而不是实际值)
有没有让这项工作?到目前为止,我没有对excel中的过滤选项留下深刻的印象,所以我想在访问之前过滤访问权限,但是如果有更好的方法来过滤excel,我会对它开放。
谢谢!