Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我一直在尝试使查询工作以 15 分钟为单位分组时间间隔。
但是,即使基于此处或其他地方的帖子,我的查询仍会按分钟而不是 15 分钟的间隔返回数据。我正在使用 Access 并想知道这是否是对 Access 的限制,或者我只是错过了一些明显的东西。
任何帮助,将不胜感激!谢谢
SELECT DATEADD("n", DATEDIFF("n", 0, [Trade.Date] ) / 15 * 15, 0), [Trade.Value] FROM Trade
Grouping requires a group by clause. For example:
group by
SELECT DATEADD("n", DATEDIFF("n", 0, [Trade.Date] ) / 15 * 15, 0) , avg([Trade.Value]) FROM Trade GROUP BY DATEADD("n", DATEDIFF("n", 0, [Trade.Date] ) / 15 * 15, 0)