ListViewCtrl and date sorting

M

Mike W.

Hi there,

I have an application that uses ListViewCtrl in several places. Most lists
show some sort of date (received, closed, etc.) and when I try to sort by
date the control sorts by month first and then year. In other words, I get
10-3-2006, 10-3-2007, 10-3-2008, 11-4-2006, 11-4-2007, 11-4-2008 instead of
10-3-2006, 11-4-2007, 12-4-2007, 10-3-2008, 11-4-2009, 12-3-2010.

The vendor says that it is a quirk of the control, but I believe that I have
seen the control sort properly in other applications.

Is there a switch/fix for this?

WinXP Pro SP3, Access 2003 SP3

Thanks much,

Mike W.
 
W

Wayne-I-M

Thats the american way of doing stuff.
Change your setting to UK dates or something like that.

Or if that does not work use DateSerial (see help file) in a query to
change it to what it should be
 
M

Mike W.

Hi Wayne,

That is definitely not the American way of sorting.

It makes sense that it may be the UK or some other way as the application
was developed in Malaysia.

Meanwhile, my computer is set for local (American) dates, etc. Where can I
find what the database is set for? I've poked around and cannot find
anything that seems relevant.

Thanks again,

Mike W.
 
D

Douglas J. Steele

It is not a case of "what the database is set for". How are you populating
the control? If you're using the Format function anywhere, then Wayne's
correct that the problem is caused by using the American mm/dd/yyyy format:
the Format function converts values to strings, and that's sorting in the
correct fashion for strings.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top