Fixed record retrieval query.