我正在尝试在MS Access报告中显示折线图,该图的y轴为温度,x轴为月。到目前为止,我已经能够创建这样的图表,但是,当我尝试将月份的数字转换为其名称时,该图表似乎按字母顺序而不是按月份的数值对x轴进行排序。 / p>
如果有人可以告诉我如何按时间顺序在图表的x轴上显示月份名称,我将不胜感激。
下面是用作图表行源的查询。
SELECT DISTINCT FormattedDataPreviousYear.Date,
FormattedDataCurrentYear.Date, FormattedDataPreviousYear.[Mean Temp (°C)],
FormattedDataCurrentYear.[Mean Temp (°C)], FormattedDataPreviousYear.Month
FROM FormattedDataPreviousYear INNER JOIN FormattedDataCurrentYear ON
(FormattedDataPreviousYear.Day = FormattedDataCurrentYear.Day) AND
(FormattedDataPreviousYear.Month = FormattedDataCurrentYear.Month)
GROUP BY FormattedDataPreviousYear.Date, FormattedDataCurrentYear.Date,
FormattedDataPreviousYear.[Mean Temp (°C)], FormattedDataCurrentYear.
[Mean Temp (°C)], FormattedDataPreviousYear.Month
ORDER BY FormattedDataPreviousYear.Date, FormattedDataCurrentYear.Date;
这是转换后的行源:
SELECT CreateTempChart.[Month], Avg([FormattedDataPreviousYear].[Mean Temp
(°C)]) AS [AvgOfFormattedDataPreviousYearMean Temp (°C)],
Avg([FormattedDataCurrentYear].[Mean Temp (°C)]) AS
[AvgOfFormattedDataCurrentYearMean Temp (°C)]
FROM CreateTempChart
GROUP BY CreateTempChart.[Month]
ORDER BY CreateTempChart.[Month];