Add conjunction to dynamic query for program case conditional queries