Event query functionality