correct sql function to handle multiple activity types
issue #23227: Reassign Activities