好的,所以我为老师提供了以下标题的时间表 Date=>StartTime=>EndTime=>Type=>Teacher=>Discipline=>Hours
它考虑了与学生一起度过的小时数 对于月底的报告
重点是总结所有数学
Date=> => =>Type=>Teacher=>Discipline=>
SELECT DISTINCTROW Format$([Sched].[Date],'Long Date') AS Date, [Sched].[Tacher], [Sched].[Discipline], [Sched].[Type], Sum([Sched].[Hours]) AS [Sum Of Hours]
FROM [Sched]
GROUP BY Format$([Sched].[Date],'Long Date'), [Sched].[Tacher], [Sched].[Discipline], [Sched].[Type];
问题是,如果您尝试按日期对此进行排序,则看起来日期
是错误的april 1=>april 13=>15=>16=>april 2(???)=>20=>23=>27=>6(???)=>8=>9
如何测试此错误?
答案 0 :(得分:0)
You can't order date strings with this format.
Order by date value:
SELECT DISTINCTROW
Format$([Sched].[Date],'Long Date') AS Date, [Sched].[Tacher], [Sched].[Discipline], [Sched].[Type], Sum([Sched].[Hours]) AS [Sum Of Hours]
FROM
[Sched]
GROUP BY
Format$([Sched].[Date],'Long Date'), [Sched].[Tacher], [Sched].[Discipline], [Sched].[Type]
ORDER BY
[Sched].[Date], [Sched].[Tacher], [Sched].[Discipline], [Sched].[Type];
or use a sortable date format:
SELECT DISTINCTROW
Format$([Sched].[Date],'yyyy-mm-dd') AS Date, [Sched].[Tacher], [Sched].[Discipline], [Sched].[Type], Sum([Sched].[Hours]) AS [Sum Of Hours]
FROM
[Sched]
GROUP BY
Format$([Sched].[Date],'yyyy-mm-dd'), [Sched].[Tacher], [Sched].[Discipline], [Sched].[Type];