Retrieveing Documents using View - Descending Ordering

I have a view created that has two columns a Topic column and a Date Column.

I have the topic column set to sort in ascending order (alphabetically) while the date column is sorting in descending order (most recent dispolaying first).

When I look at the view , everything appears to be in order:

Bill 30 20041105

Bill 30 20041030

However, when I access the viwe in my agent, and display the results on the web, the October record displays first.

I tried to put the date column first and hide it, but then my search failed.

sSearchType = “Topic”

.

.

Elseif sSearchType = “Date” Or sSearchType = “Topic” Then

Set co = view.GetAllDocumentsByKey(sKey)

Set doc = co.GetFirstDocument

Else

.

.

Do While Not (doc Is Nothing)

    sTopic = doc.Topic(0)

    sDetail = doc.Details(0)

	

If sSearchType = "" Then

	sDocDate = doc.ColumnValues(0)

	If sDocDate <> sSeminarDate Then

		Goto GetNextRec

	End If

Elseif sSearchType = "Keyword" Then

	If Instr(1, Ucase(sDetail), 

               case(sKey)) = 0 Then

		Goto GetNextRec

	End If

End If

sMonth = doc.Month(0)

sDay = doc.Day(0)

sYear = doc.Year(0)

sDetailDate = sMonth & " " & sDay ", " & sYear

sID = doc.UniversalID

sURL = "/intranet/MicroSem.nsf/Region/" & sID & "?EditDocument"

Gosub AddRowItem

GetNextRec:

If sSearchType = "Date" Or sSearchType="Topic" Then

	Set doc = co.GetNextDocumen(doc)

Else

	Set doc = view.GetNextDocument (doc)

End If

Loop

Why doesn’t the November document get picked up first? Any ideas or suggestions would be greatly appreciated. Thanks in advance.

Subject: collections are not sorted

This is an age-old issue with collections: their order is NOT the same as the view index. Don’t like it? Try one of the publicly-posted collection-sorting algorithms.

Subject: RE: collections are not sorted

If you would like to mail me I can talk you through this.

Subject: RE: collections are not sorted

Or just use GetAllEntriesByKey instead, since that does return its results in view order.