$ 0 0 You need to first find the END Date of previous record in variable and then check it in condition