![]() |
How do I make this sort correctly? |
Post Reply ![]() |
Author | |
idolpx ![]() Newbie ![]() Joined: 24 February 2005 Status: Offline Points: 20 |
![]() ![]() ![]() ![]() ![]() Posted: 17 December 2006 at 3:36pm |
I need it to sort as a number. but it's doing a text sort.
![]() I thought there was a SortAsNumber property for the Column object but I guess I was wrong. Any ideas? |
|
![]() |
|
Oleg ![]() Senior Member ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi,
I think you have to set Item.Value as Single and set Format property to "$%s" to automatically add "$" - it will increase perfomance of sorting and will sort in right order.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
idolpx ![]() Newbie ![]() Joined: 24 February 2005 Status: Offline Points: 20 |
![]() ![]() ![]() ![]() ![]() |
Perfect! That did the trick. :)
Thanks! |
|
![]() |
|
LittleJK ![]() Senior Member ![]() ![]() Joined: 13 April 2006 Status: Offline Points: 168 |
![]() ![]() ![]() ![]() ![]() |
Quick Question how would you sort on a date field where it's grouped? We have a date field that is being already formated to capture the time and then split out the date.
Set RecordItem = .AddItem(CDate(CheckForNull(rs.Fields("d_datemade")))) RecordItem.Format = "%I:%M %p" RecordItem.GroupCaption = Format$(CheckForNull(rs.Fields("d_datemade")), "mm/dd/yyyy") The issue is that when we group by the date, we want it to be sorted in order based upon the most recent time. Due to that it's interpreting the group line as text, 1/1/06 would come before 1/1/07 when in all actuality 1/1/07 should be coming first. We didn't notice this due to if it's the same year the month and day would make it seem to appear to being sorted correctly. |
|
![]() |
|
sserge ![]() Moderator Group ![]() Joined: 01 December 2004 Status: Offline Points: 1297 |
![]() ![]() ![]() ![]() ![]() |
If you set cell values not as a text, but as OLE Variant values (native COM date/time) -- it will be both sorted and grouped correctly. -- 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 |