Hi @rnowitzki Thnaks for the replay and info. I have used the same as you suggested but the result is not as expected, | eval curr_date_hour = strftime(now(), "%H")
| eval status=if(curr_date_hour>substr(SLA_start_time,1,2) AND curr_date_hour>=substr(SLA_end_time,1,2), "COMPLETED", if(curr_date_hour<substr(SLA_start_time,1,2),"NOT_STARTED", if(curr_date_hour>=substr(SLA_start_time,1,2) AND curr_date_hour<substr(SLA_end_time,1,2),"RUNNING", "ERROR_IN_STATUS_DETECTION"))) Output: : Here highlighted jobs are started at 6 pm, 8 pm, and 9 pm today and supposed to complete next day 01:00 am but still its showing completed, I was executed this search at 10 pm. please help on this same. I have day field as date_mday which stores day value like 14, So i alerted the query to compare current day with date_mday as shown below but no luck. | eval curr_date_hour = strftime(now(), "%H") | eval curr_day = strftime(now(), "%d") | eval status=if(curr_date_hour>substr(SLA_start_time,1,2) AND curr_date_hour>=substr(SLA_end_time,1,2), "COMPLETED", if(curr_date_hour<substr(SLA_start_time,1,2) AND (curr_day!=date_mday),"NOT_STARTED", if(curr_date_hour>=substr(SLA_start_time,1,2) AND curr_date_hour<substr(SLA_end_time,1,2),"RUNNING", "ERROR_IN_STATUS_DETECTION"))) I have a fields like DATE=2020-06-14 date_mday=14 date_month=06 date_year=2020 SLA_start_time and SLA_end_time. Please help me this and thanks in advance.
... View more