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.
我有一份关于何时分发物品的清单。该表具有以下结构:
我想计算从发出一个对象到发出下一个对象之间的平均时间长度。将有许多不同的项目需要列出讲义之间的平均时间。
所以像(伪代码):
平均([thisrecord]![datehandedout] - [lastrecord]![datehandedout])
任何帮助都感激不尽。
这是一个非常慢的查询:
SELECT Avg(DateDiff("h",[datehandedout],( SELECT TOP 1 datehandedout FROM tbl tx WHERE tx.datehandedout > t.datehandedout))) AS Difference FROM tbl AS t
添加另一个 Where 语句来限制测试时返回的记录数,例如:
WHERE Year([datehandedout])=2010