Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > General Discussion
  New Posts New Posts RSS Feed - Sorting Date
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Sorting Date

 Post Reply Post Reply
Author
Message
flauzer View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 December 2003
Location: Italy
Status: Offline
Points: 108
Post Options Post Options   Thanks (0) Thanks(0)   Quote flauzer Quote  Post ReplyReply Direct Link To This Post Topic: Sorting 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
Back to Top
gshawn View Drop Down
Senior Member
Senior Member


Joined: 04 October 2004
Status: Offline
Points: 227
Post Options Post Options   Thanks (0) Thanks(0)   Quote gshawn Quote  Post ReplyReply Direct Link To This Post 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"))

?

 

Back to Top
flauzer View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 December 2003
Location: Italy
Status: Offline
Points: 108
Post Options Post Options   Thanks (0) Thanks(0)   Quote flauzer Quote  Post ReplyReply Direct Link To This Post 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......



Back to Top
flauzer View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 December 2003
Location: Italy
Status: Offline
Points: 108
Post Options Post Options   Thanks (0) Thanks(0)   Quote flauzer Quote  Post ReplyReply Direct Link To This Post Posted: 18 March 2005 at 7:11am
PS....
.....long limit is 2147483647

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
flauzer View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 December 2003
Location: Italy
Status: Offline
Points: 108
Post Options Post Options   Thanks (0) Thanks(0)   Quote flauzer Quote  Post ReplyReply Direct Link To This Post 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
 
Back to Top
flauzer View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 December 2003
Location: Italy
Status: Offline
Points: 108
Post Options Post Options   Thanks (0) Thanks(0)   Quote flauzer Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.141 seconds.