Update queries to filter by date (bug 996723)