Check for from date and to date