I would approach this problem with a two fold solution. First convert the
months to numeric for ease of sorting. I would use a Case Statment for that.
Then store the data in a database which you can then retrieve in any order
you like.
Dim dblIndex As Double
Dim strMonth As String
Dim intYear As Integer
Dim intMonth As Integer
Dim filename As String
Open filename For Input As #1
Input #1, dblIndex, strMonth, intYear
'Convert Month to numeric
Select Case strMonth
Case "Jan", "January", UCase("January")
intMonth = 1
Case "Feb", "Febuary", UCase("Febuary")
intMonth = 2
Case "Mar", "March", UCase("March")
intMonth = 3
Case "Apr", "April", UCase("April")
intMonth = 4
....
End Select
Add record to database:
Dim RS As Recordset
....
RS.Fields("Index") = dblIndex
RS.Fields("Month") = intMonth
RS.Fields("Year") = intYear
RS.Update
Retrieve record in asc order:
RS.open "Select * From database Order By Year,Month,Index", conn,
adOpenDynamic
"Terry" <TR*****@aol.com> wrote in message
news:1106222107.ead5bf9368f49d6833298cede41b531c@t eranews...
I have a text file with an unknown number of entries in it. The data
in the text file is in this format:
22.9,"June",2004
6.7,"July",2003
18.3,"June",2004
dblIndex, strMonth, intYear
How do I sort these by date (from newest to oldest) and if the records
have the same date, from lowest dblIndex to highest?
Any help with this problem would be greatly appreciated.