以下查询在 MS Access 中运行良好,但我实际上只想获取 Main Project 字段加上 Name 的计数。就像是:
SELECT Sheet1.[Main project], Count(Sheet1.[Name]) AS Total
当我这样做时,我收到以下错误:
“您尝试执行的查询不包含指定表达式‘主项目’作为聚合函数的一部分’
我在加入中做错了吗?知道什么是不正确的吗?
SELECT Sheet1.[Main project], Sheet1.[Main link], Sheet1.[Name]
FROM Sheet1
INNER JOIN Sheet1 AS Sheet1_1
ON (Sheet1.[Main link] = Sheet1_1.[Main link]
AND Sheet1.[Main project] = Sheet1_1.[Main project])
WHERE Sheet1_1.[Name] ='0.4 Rollout plan approved'
AND Sheet1_1.[%compl#] = 100
AND (Sheet1_1.[Task class] <> '***Sammelvorgang' AND Sheet1_1.[Task class] <> '' AND Sheet1_1.[Task class] <> 'M D-Muster')
AND Sheet1.[Main project] = 'AUDI AG, Ingolstadt'
AND (Sheet1.[Task class] <> '***Sammelvorgang' AND Sheet1.[Task class] <> '' AND Sheet1.[Task class] <> 'M D-Muster')
AND (Sheet1.[Name] NOT LIKE '0.*' AND Sheet1.[Name] NOT LIKE '1.*')
AND Sheet1.[Start] < DateAdd("d",-7,Now())