fix query with last version found in file

git-svn-id: https://svn.forgerock.org/openidm/trunk@4690 d98387aa-ee2c-4292-a9e6-504d2a719fd3