Quwey history data for time and candidate user/groups

Now it is necessary to query historical data based on candidate information and time, but at present, the query of joining time seems to be invalid. Code show as below:

Looking forward to your help!