访问-计算3个查询中的行并返回Pie Char

时间:2019-05-17 10:46:38

标签: ms-access

我正在寻找一些帮助将数据整理到Microsoft Access中的饼图中。

我在表格中列出了员工培训的清单,其中有更新日期-员工培训

我有3个单独的查询可以拉出

约会培训
过时的培训
培训没有添加日期

我需要计算每行中有多少行,然后将这些数据组合成饼图,以显示“ In Date”,“ Out of Date”和“ No Date”的百分比。

我的3个查询有效,每个查询的底部都有一个计数,给出了相关的数字。我只是想不出如何访问此数字并进入饼图。

任何帮助将不胜感激。

SELECT [Staff Training].[Staff Member], [Staff Training].ID, 
[Staff Training].Area, [Staff Training].Course, [Staff Training].[Refresher Date]
FROM [Staff Training]
WHERE ((([Staff Training].[Refresher Date])<=Now()));

SELECT [Staff Training].ID, [Staff Training].[Staff Member], 
[Staff Training].Area, [Staff Training].Course, [Staff Training].[Refresher Date]
FROM [Staff Training]
WHERE ((([Staff Training].[Refresher Date])>Now()));

SELECT [Staff Training].ID, [Staff Training].Area, [Staff Training].Course,
[Staff Training].[Refresher Date], [Staff Training].[Staff Member]
FROM [Staff Training]
WHERE ((([Staff Training].[Refresher Date]) Is Null));

数据格式:

Data format

1 个答案:

答案 0 :(得分:0)

SELECT  IIf ( ([Staff Training].[Refresher Date]) Is Null ,0 , IIf ( ([Staff Training].[Refresher Date])<=Now() ,1, 2) )    FROM [Staff Training]

SELECT  IIf ([Staff Training].[Refresher Date] Is Null ,"Training with no date added" , IIf ( [Staff Training].[Refresher Date]<=Now() ,"In Date Training", "Out of Date Training"))    FROM [Staff Training]