J
jutlaux
I have a 1 table that records date/time for different pieces of equipment.
I am trying to calculate the difference between times for all the records.
The data looks like this:
CURE_START_DATE_TIME PRESS_NAME
1/5/2009 10:00:06 AM U14
1/5/2009 10:00:06 AM U14
1/5/2009 10:00:11 AM V04
1/5/2009 10:00:11 AM V04
1/5/2009 10:00:12 AM S15
1/5/2009 10:00:12 AM S15
I have read a couple post on this and have tired using the datediff function
and generated the following SQL
SELECT CURE_START_DATE_TIME, PRESS_NAME, DateDiff("s",(SELECT
MAX(CURE_START_DATE_TIME) FROM tblTemporary2 WHERE PRESS_NAME=M.PRESS_NAME
AND CURE_START_DATE_TIME<M.CURE_START_DATE_TIME),[CURE_START_DATE_TIME]) AS
DowntimeCalc
FROM tblTemporary2 AS M;
The problem I have is that when I run the Query the DowntimeCalc field
is empty for all records. What am I missing?
Thanks
I am trying to calculate the difference between times for all the records.
The data looks like this:
CURE_START_DATE_TIME PRESS_NAME
1/5/2009 10:00:06 AM U14
1/5/2009 10:00:06 AM U14
1/5/2009 10:00:11 AM V04
1/5/2009 10:00:11 AM V04
1/5/2009 10:00:12 AM S15
1/5/2009 10:00:12 AM S15
I have read a couple post on this and have tired using the datediff function
and generated the following SQL
SELECT CURE_START_DATE_TIME, PRESS_NAME, DateDiff("s",(SELECT
MAX(CURE_START_DATE_TIME) FROM tblTemporary2 WHERE PRESS_NAME=M.PRESS_NAME
AND CURE_START_DATE_TIME<M.CURE_START_DATE_TIME),[CURE_START_DATE_TIME]) AS
DowntimeCalc
FROM tblTemporary2 AS M;
The problem I have is that when I run the Query the DowntimeCalc field
is empty for all records. What am I missing?
Thanks