Ms access 如何在access数据透视列中按月份名称排序?
我有以下pivot查询:Ms access 如何在access数据透视列中按月份名称排序?,ms-access,Ms Access,我有以下pivot查询: TRANSFORM Sum(Forecast.Openquantity) AS OpenQty SELECT Forecast.Material, Forecast.Description, Forecast.Unrestricted FROM Forecast GROUP BY Forecast.Material, Forecast.Description, Forecast.Unrestricted ORDER BY Forecast.Material, Forec
TRANSFORM Sum(Forecast.Openquantity) AS OpenQty
SELECT Forecast.Material, Forecast.Description, Forecast.Unrestricted
FROM Forecast
GROUP BY Forecast.Material, Forecast.Description, Forecast.Unrestricted
ORDER BY Forecast.Material, Forecast.Description, MonthName(Month([Forecast].[LoadingDate]))
PIVOT MonthName(Month([Forecast].[LoadingDate]));
这很好,但是月份名称(列行)是按字母顺序排序的,而不是按月份编号排序的
上面的查询按以下顺序给我列:四月、八月、十二月、二月
我要几个月的正常订单:一月,二月,三月
如何更改此查询以对月份名称列进行正确排序 您可以这样做:
PIVOT MonthName(Month([Forecast].[LoadingDate])) IN ("January","February", ... ,"December");
你是这样做的:
PIVOT MonthName(Month([Forecast].[LoadingDate])) IN ("January","February", ... ,"December");