- Are you sure $rsold[“fecha_inicio”] is correct? If both fields are from the new or updated record, it should be $rsnew[“fecha_inicio”].
- To compare dates, you should not compare them directly as string, read: https://discourse.hkvstore.com/t/start-date-minus-end-date-equal-to-total/635/1