Date Sorting Problem |
Post Reply |
Author | |
rob@shuksan.com
Newbie Joined: 04 September 2007 Location: United States Status: Offline Points: 2 |
Post Options
Thanks(0)
Posted: 12 September 2007 at 11:39am |
I am looking for a way to properly sort a report column by date. I need the column to sort in descending order where the most recent date is on top.
wndReportControl.SortOrder.Add wndReportControl.Columns(COLUMN_SENT)
wndReportControl.SortOrder(0).SortAscending = False wndReportControl.Populate The results come out as such:
9/3/2007 9:31 PM
9/11/2007 8:48 PM
9/1/2007 6:46 AM
Any help would be appreciated. Thx. |
|
sserge
Moderator Group Joined: 01 December 2004 Status: Offline Points: 1297 |
Post Options
Thanks(0)
|
The control will sort date/time columns automatically, but you have to properly set Value of corresponding items.
It looks for me that you sent a datetime value as a simple String, and it is sorted using String comparison rules. -- WBR, Serge |
|
albrecht
Newbie Joined: 09 November 2007 Status: Offline Points: 1 |
Post Options
Thanks(0)
|
I have the sam problem,
tried to add a date value to an item
(as string and as date) but
sorting by date doesn't correct sort
could this be because of the windows
language setting?
I have also the Problem if I have a Size Column
with mixed SizeValues (xx KB, yy MB, ...) the sorting
is always alphabetic not numeric...
so I also hope for help :-)
regards
|
|
sserge
Moderator Group Joined: 01 December 2004 Status: Offline Points: 1297 |
Post Options
Thanks(0)
|
Well, when .Value property is available -- it sorts using it's Variant value (which may be numeric, date or anything else). Otherwise it sorts by text strings. It depends on how do you initialize items in your code. -- WBR, Serge |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |