SELECT TO_DAYS(fecha_pago)-TO_DAYS(fecha_limite_pago) AS dias from table WHERE TO_DAYS(fecha_pago)-TO_DAYS(fecha_limite_pago) > 1