select correct date ID after searching