Hi All,
I am facing a problem while getting sorted data from document collection. What i have done is…
I have a view named view1. it has two column. 1st contains user name and 2nd contains entryDate which is date type field. both are sorted ascending and in the view it is showing properly. In the lotus script i use
dim dc as notesdocumentcollection
dim ss as new notessession
dim doc as notesdocument
dim createdDate as string
Set view = db.GetView(“View1”)
set dc = view.GetAllDocumentsByKey(ss.CommonUserName,True)
set doc = dc.getFirstDocument()
while not (doc is nothing)
if createdDate=“” then
createdDate = doc.entryDate(0)
else
createdDate = createdDate &“,” & doc.EntryDate(0)
end if
set doc = dc.getNextDocument(doc)
wend
What the result it is displaying is :
10/12/2007,31/12/2007,26/11/2007,3/12/2007,17/12/2007,24/12/2007,10/12/2007
if i want to get last document entryDate it return me 10/12/2007. where as in the view last document created by given user is 31/12/2007.
One more workaround i have done to get sorted list is
dim entryDateArr as varient
entryDateArr = Split(entryDate,“:”)
entryDateArr = Evaluate(“@Sort(” & Cstr(entryDate) & “)”)
Which returns Type Mismatch Error.
The main objective is i want to get the lated created document which is 31/12/2007 if you looks my above string data…
Is there any way to sort the documentcollection so that after sorting i can directly go to last document and get the doc.EntryDate(0) which will return me 31/12/2007.
I also searched this forum but not get exact result. please help me. it is an urgent for me…
I will be very thankful to you.
With Regards
Vikas K Sinha