This is more of a 2nd part of a question that start off here here
The code below works great but I forgot something, there is also a City and State before the Date/Time, Example is:
strcountstf = "Chicago, IL,02/01/2012 3:05am###,Akron,OH,02/02/2012 7:05am###,Nashivlle,TN,02/05/2012 8:30pm###"
strDateNTimes = "Buffalo,NY,03/01/2011 2:20am###,Las Vegas,NV,12/02/2012 8:00am###,Mount Vernon,IN,02/06/2012 6:45pm###"
Below is the working code but I forgot to add the City and State into strcountstf and strDateNTimes string. Now when the City,State is added it does not work.
I would like to sort it by Date/Time but show the City,State as the Output/Result... please help AGAIN!! (I know, I know).
dim strcountstf
dim strDateNTimes
dim strCOMBO
dim arrCOMBO
dim strCOMBOSorted
dim objSortedList
dim i
strcountstf = "02/01/2012 3:05am###,02/02/2012 7:05am###,02/05/2012 8:30pm###"
strDateNTimes = "03/01/2011 2:20am###,02/02/2012 8:00am###,02/06/2012 6:45pm###"
strCOMBO = strcountstf & "," & strDateNTimes
arrCombo = Split(strCOMBO, ",")
Set objSortedList = Server.CreateObject("System.Collections.SortedList")
For i = LBound(arrCombo) To UBound(arrCombo)
Call objSortedList.Add(CDate(Replace(arrCombo(i), "###", "")), arrCombo(i))
Next
strCOMBOSorted = ""
For i = 0 To objSortedList.Count - 1
strCOMBOSorted = strCOMBOSorted & ", " & objSortedList.GetByIndex(i)
Next
strCOMBOSorted = Right(strCOMBOSorted, Len(strCOMBOSorted) - 2)
Set objSortedList = Nothing
Response.Write("<br>")
Response.Write(strCOMBO)
Response.Write("<br>")
Response.Write(strCOMBOSorted)