Print Page | Close Window

Sorting of Date-Columns

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=3581
Printed Date: 24 April 2024 at 9:46pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Sorting of Date-Columns
Posted By: cbickel
Subject: Sorting of Date-Columns
Date Posted: 31 January 2006 at 4:22pm
How can I specify columns as "date" - columns to get them sorted properly ?

-------------
Christian Bickel
Consolidate



Replies:
Posted By: sserge
Date Posted: 01 February 2006 at 4:37am
Hi,

Look into Sub SetDateItem() in the sample app. When you set item value with Date type, it will be automatically properly sorted.

--
WBR,
Serge


Posted By: LeeHayton
Date Posted: 02 February 2006 at 4:27am

When you add the date the report does not know what type of field it is so you need to tell it by encapsulating it in the CDate() command.

             Set Item = Record.AddItem(CDate(RS!RegDate))

This works great for me!

The same goes for strings cstr(), integers cint(), etc. which orders number columns numerically as opposed to alphabetically.




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net