Hi Abu Salam
Could you please share data from 23rd Jan to 24th Jan? Based on your data from 24th to 25th Jan it shows 24 hours on 25th Jan 12:00:00 AM.
If you are planning to calculate run hours then would suggest you to use : Round(TimeEQ('RUN_STATUS','y','t',"RUN")/3600)
Hi Lal Babu,
Here you go with the data. It gives the same results if I use TimeEQ instead of TimeNE.
23-Jan-19 03:52:59 Stopped 23-Jan-19 11:43:00 Stopped 23-Jan-19 13:48:49 Running 23-Jan-19 14:33:50 Stopped 23-Jan-19 14:49:24 Running 23-Jan-19 22:39:57 Running 24-Jan-19 06:29:57 Running 24-Jan-19 08:26:14 Bad 24-Jan-19 08:28:59 Running 24-Jan-19 08:38:14 Bad 24-Jan-19 08:40:58 Running 24-Jan-19 08:56:14 Bad 24-Jan-19 08:58:59 Running 24-Jan-19 16:50:11 Running
2 of 2 people found this helpful
Hi Abu Salam
Based on the input data from 23-24th, I have considered from 23rd midnight to 24th midnight based on your expression and it shows approx 10 hours and inline with your analysis output mentioned in your post. Apologies If I have misunderstood your query.
TimeStamp Status Run Hours 3/1/19 3:52 Stopped 23/1/19 11:43 Stopped 23/1/19 13:48 Running 23/1/19 14:33 Stopped 0:45:01 23/1/19 14:49 Running 23/1/19 22:39 Running 24/1/19 0:00 Running 9:10:36
1 of 1 people found this helpful
Hi Abu Salam,
As Lal Babu Shaik mentioned, it appears the calculation is correct. But just remember that since your calculation uses 'y' and 't' as the start and end times, which correspond to yesterday at midnight and today at midnight, the calculation output on 1/24/2019 12:00:00am is actually calculating for January 23rd, the time period of 1/23/2019 12:00:00am - 1/24/2019 12:00:00am, and this looks to be correct that the status was not "STOP" for only 10 hours.
To know how many hours the status was not "STOP" for January 24th, you would look at the output from 1/25/2019 12:00:00am, which is 24, and this looks correct based on your data that the status was not "STOP" for that whole day.