在交叉表输出中显示 'X' 代替计数值
Display 'X' in crosstab output in place of count value
我在 MSAccess 中有一个交叉表查询,它显示每个列标题的出现次数。我想用 'X' 代替任何整数。
我可以将 TRANSFORM 语句两处的单词 Count 更改为 First,它会在每行中显示列标题来代替 Count,但我无法插入 'X' ...
Header 看起来像这样:
|网站编号 | 737 | 747 | 757 | ...
结果如下:
|网站 15 | 5 | 5 | 5 | ...
想要的结果:
|网站 15 | × | × | × | ...
SQL:
TRANSFORM Count([tblPART-TO-AIRCRAFT].ACType) AS CountOfACType
SELECT [tblPART-TO-AIRCRAFT].[SITE ID]
FROM [tblPART-TO-AIRCRAFT]
GROUP BY [tblPART-TO-AIRCRAFT].[SITE ID]
PIVOT [tblPART-TO-AIRCRAFT].[ACType];
考虑:
TRANSFORM IIf(Count(*) IS NULL, Null, "X") AS CountOfACType
SELECT [tblPART-TO-AIRCRAFT].[SITE ID]
FROM [tblPART-TO-AIRCRAFT]
GROUP BY [tblPART-TO-AIRCRAFT].[SITE ID]
PIVOT [tblPART-TO-AIRCRAFT].[ACType];
我在 MSAccess 中有一个交叉表查询,它显示每个列标题的出现次数。我想用 'X' 代替任何整数。
我可以将 TRANSFORM 语句两处的单词 Count 更改为 First,它会在每行中显示列标题来代替 Count,但我无法插入 'X' ...
Header 看起来像这样: |网站编号 | 737 | 747 | 757 | ...
结果如下: |网站 15 | 5 | 5 | 5 | ...
想要的结果: |网站 15 | × | × | × | ...
SQL:
TRANSFORM Count([tblPART-TO-AIRCRAFT].ACType) AS CountOfACType
SELECT [tblPART-TO-AIRCRAFT].[SITE ID]
FROM [tblPART-TO-AIRCRAFT]
GROUP BY [tblPART-TO-AIRCRAFT].[SITE ID]
PIVOT [tblPART-TO-AIRCRAFT].[ACType];
考虑:
TRANSFORM IIf(Count(*) IS NULL, Null, "X") AS CountOfACType
SELECT [tblPART-TO-AIRCRAFT].[SITE ID]
FROM [tblPART-TO-AIRCRAFT]
GROUP BY [tblPART-TO-AIRCRAFT].[SITE ID]
PIVOT [tblPART-TO-AIRCRAFT].[ACType];