case when (emt.real_end_time <= emt.end_time and emt.working_hours <= emp.limit_duration) then 1 else 2 end AS complete_tag,
case when (emt.real_end_time <= emt.end_time and CAST(emt.working_hours AS DECIMAL(10, 2)) <= CAST(emp.limit_duration AS DECIMAL(10, 2))) then 1 else 2 end AS complete_tag,