Excuse the code: I am typing it without benefit of a Domino Designer Client. You could write this as a function and pass in the parameters to make it reusable
var db:NotesDatabase = session.getDatabase(sessionScope.SurvDbName);
var view:NotesView = db.getView('AGENTAllSurveys');
var coll:NotesDocumentCollection = view.getAllDocumentsByKey(lookupKey, true);
var doc:NotesDocument = coll.getFirstDocument();
var tmpDoc:NotesDocument;
var returnedValues:java.util.Vector = new java.util.Vector();
while(doc != null)
{
tmpDoc = coll.getNextDocument(doc);
returnedValues.add(doc.getItemValue('ReturnedDate'));
doc.recycle();
doc = tmpDoc;
}
...then you have the returnedValues Vector to do with what you will. You can check each value to see if it is null or do a typeof to get its data type, or even both.