Fix daily update query