Checks for duplication in query_date->execute()

Please double check if the changes made were correct. Thank you! :D