MS Excel访问查询在Excel

时间:2015-06-12 09:00:10

标签: sql excel ms-access


以下查询在MS Access 2010中正确运行,但在MS Excel 2010中运行时,它返回的记录较少。

SELECT Population.[Country Grouping], Population.[Legal Staff Country], Population.[Service Line], Population.[Indirect Function], Population.Corporation, IIf(IsNull([Q_Man_SEC_Moodle.DAS])=False,"Successful",IIf([Q_Man_SEC_Successful.History Status]="Successful","Successful",IIf([Q_Man_SEC_InProgress.History status]="Not Evaluated","Not Evaluated","Not Registered"))) AS Result, 1 AS [Counter]
FROM ((Population LEFT JOIN Q_Man_SEC_Successful ON Population.[User Name] = Q_Man_SEC_Successful.[Learner Das id]) LEFT JOIN Q_Man_SEC_InProgress ON Population.[User Name] = Q_Man_SEC_InProgress.[Learner Das id]) LEFT JOIN Q_Man_SEC_Moodle ON Population.[User Name] = Q_Man_SEC_Moodle.DAS;

我认为问题出在Isnull([Q_Man_Sec_Moodle.DAS]) = False部分。
看起来这些记录不包括在内 Q_Man_Sec_Moodle查询如下:

SELECT DISTINCTROW [Moodle Data].DAS
FROM [Moodle Data]
WHERE ((([Moodle Data].SCORM) Like "*SEC_AW*") AND (([Moodle Data].[completed?])=1))
GROUP BY [Moodle Data].DAS;

非常感谢任何帮助。

1 个答案:

答案 0 :(得分:0)

那么这样吗?

SELECT DISTINCTROW [Moodle Data] .DAS 来自[Moodle数据] WHERE((([Moodle Data] .SCORM)ALIKE“%SEC_AW%”)和(([Moodle数据]。[完成?])= 1)) GROUP BY [Moodle Data] .DAS;