我试图找到不同列和行中两个日期之间的差异。
在这个命令中,我在同一行上有所作为:
SELECT
FACTRY.finish_datetime,
FACTRY.start_datetime,
DateDiff("n",[finish_datetime],[start_datetime]) AS date_diff
FROM FACTRY
WHERE (((FACTRY.job_number)='30'));
输出:
+---------------------+---------------------+-----------+
| start_date_time | finish_date_time | date_diff |
+---------------------+---------------------+-----------+
| 17/08/2016 20:24:00 | 17/08/2016 20:25:00 | -1 |
| 17/08/2016 20:25:00 | 17/08/2016 21:00:00 | -35 |
| 17/08/2016 21:00:00 | 17/08/2016 21:01:00 | -1 |
| 17/08/2016 21:01:00 | 17/08/2016 21:02:00 | -1 |
+---------------------+---------------------+-----------+
在Oracle中,以下SCRIPT可以正常工作。
SELECT
start_date,
finish_date,
LEAD(finish_date, 1) OVER (ORDER BY finish_date) AS NextFinish
FROM FACTRY
WHERE job_number = 30;
但是在ACCESS这些功能不可用时,任何人都知道怎么做?