select case when to_char(loss_occurred_date,'yyyy-mm-dd')>='${startdate1}' and to_char(loss_occurred_date,'yyyy-mm-dd')<='${enddate1}' and loss_occurred_cnt=1 then ABS(datedif(nvl(pr.report_date,TIMESTAMP('${enddate1}'||'23:59:59')),pr.accident_date,'hh') ) else 0 end as accident_report_hh from holo_ads_agidep_case_cycle_stat_dd prwhere report_time is null