Print Page | Close Window

Sorting Date

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: General Discussion
Forum Description: Topics Related to Active-X COM Development in General
URL: http://forum.codejock.com/forum_posts.asp?TID=1984
Printed Date: 22 November 2024 at 1:08pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Sorting Date
Posted By: flauzer
Subject: Sorting Date
Date Posted: 18 March 2005 at 4:12am
sorry.....old problem on ReportControl (9.6.0.1 version )

Is there a way,(trick,workaround,....)
that can sort a dateTIME column correctly.... (it has to work with at data and a TIME)????????


PS
Item.SortPriority = CLng(Format(CStr(f.Value), "yyyymmddhh")) works until HOURS
and not MINUTE......


Thanks



Replies:
Posted By: gshawn
Date Posted: 18 March 2005 at 5:35am

Originally posted by flauzer flauzer wrote:

Item.SortPriority = CLng(Format(CStr(f.Value), "yyyymmddhh")) works until HOURS and not MINUTE......

Is there any reason why you can't do

Item.SortPriority = CLng(Format(CStr(f.Value), "yyyymmddhhmmss"))

?

 



Posted By: flauzer
Date Posted: 18 March 2005 at 7:04am
I'd got "overflow" problem , to be honest some month ago....

I only want to know if someone uses correctly the datetime format without problems.

Thanks......





Posted By: flauzer
Date Posted: 18 March 2005 at 7:11am
PS....
.....long limit is 2147483647



Posted By: Oleg
Date Posted: 18 March 2005 at 7:27am

How you add this report item?

Try simply add it as date value.



-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: flauzer
Date Posted: 18 March 2005 at 8:01am
The problem is DATETIME.

This is my function, the result is WRONG:::

ie:.... I obtain in Data column (decrescent):

23/10/2005 14.56
23/08/2005 14.53
14/05/2005 14.52
13/07/2005 14.53
06/03/2004 14.51
03/11/2005 14.56
03/06/2005 14:53




Public Function WrapRP(ByVal f As Field, ByRef Item As ReportRecordItem)
    '----------------------------------------------------
    'Wrap CodeJock grid
    '----------------------------------------------------
    Select Case f.Type
    
         &nbs p;       Case adDBTimeStamp, adDBDate
         &nbs p;          
         &nbs p;           If IsNull(f) Then
         &nbs p;               Item.Value = vbNullString
         &nbs p;           Else
         &nbs p;               Item.Value = Format(CStr(f.Value), "dd/mm/yyyy hh:mm")
         &nbs p;               Item.SortPriority = CLng(Format(CStr(f.Value), "yyyymmddhhmm"))
         &nbs p;           End If
         &nbs p;          
         &nbs p;      Case Else
         &nbs p;          
         &nbs p;           If IsNull(f) Then
         &nbs p;               Item.Value = vbNullString
         &nbs p;           Else
         &nbs p;               Item.Value = CStr(f)
         &nbs p;           End If
         &nbs p;
    End Select
   
   
End Function
 


Posted By: flauzer
Date Posted: 18 March 2005 at 8:10am
Oleg,

I understand the changes....

Item.Value = f.Value

and 'after' use the FORMAT method.....
Item.Format =.....


This work!!!Embarrassed



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