Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21266

[RESOLVED] Date sort in MSFlexGrid problem

$
0
0
Attachment 95727

I have searched the net and forums for the answers, and have tried many, but still can't get this right.
I am trying to sort a msflexgrid (grid1) by a column which lists birth dates.

Here is an excerpt of my code, and a picture of what I get. (Note that the dates are NOT in order). What did I miss?

Code:

    grid1.TextMatrix(x, 2) = rs!child1
    grid1.TextMatrix(x, 3) = Format(rs!child1Bday, "YYYY-MM-DD")
        age = DateDiff("YYYY", rs!child1Bday, Date)
        If age > 1 Then
            grid1.TextMatrix(x, 4) = age & "years"
        Else
            grid1.TextMatrix(x, 4) = DateDiff("M", rs!child1Bday, Date) & "months"
        End If

then I used the grid's built in sort routine:

Code:

    grid1.Col = 3
    grid1.Sort = flexSortNumericDescending

Attached Images
 

Viewing all articles
Browse latest Browse all 21266

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>