Updated SQL query for open displayed.