Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Date Sort in Subreport not sorting correctly Post Reply Post New Topic
Author Message
vzh101
Groupie
Groupie
Avatar

Joined: 12 Feb 2015
Location: United States
Online Status: Offline
Posts: 46
Quote vzh101 Replybullet Topic: Date Sort in Subreport not sorting correctly
     Posted: 01 Oct 2015 at 5:29am
Anyone have this problem that the record in the sub-report sorted by date is incorrect?

For example:

ID   Name   Appointment
1     A      3/19/2013
2     B      7/06/2015
3     C      6/19/2015
4     D      6/19/2015


It seems to be correct order after Name "B". Any idea? Thanks in advance
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 01 Oct 2015 at 6:06am
are you sorting it as a string type or a date type.

Edited by DBlank - 01 Oct 2015 at 7:39am
IP IP Logged
vzh101
Groupie
Groupie
Avatar

Joined: 12 Feb 2015
Location: United States
Online Status: Offline
Posts: 46
Quote vzh101 Replybullet Posted: 01 Oct 2015 at 6:50am
I checked that field and it's DateTime Type.
IP IP Logged
vzh101
Groupie
Groupie
Avatar

Joined: 12 Feb 2015
Location: United States
Online Status: Offline
Posts: 46
Quote vzh101 Replybullet Posted: 01 Oct 2015 at 6:55am
I forgot to mention that I have formula to show just the 5 records using a Suppress (No Drill-down) forumla in the Section Expert.

RecordNumber<=Count({ApptTable.ApptID})-5


Do you think this is the cause?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 01 Oct 2015 at 7:23am
Is the example you showed all fields in one sub report?
What is the set up of the design sub report? any grouping. Any sort order beside the date field?
IP IP Logged
vzh101
Groupie
Groupie
Avatar

Joined: 12 Feb 2015
Location: United States
Online Status: Offline
Posts: 46
Quote vzh101 Replybullet Posted: 01 Oct 2015 at 7:36am
Yes, all the fields in one sub report. There is no grouping nor any sort order beside the date field.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 01 Oct 2015 at 7:47am
Your suppression seems like it is getting the last 5 records which should not impact this.
You are sure that the field you are displaying is also the field that you are sorting on?
IP IP Logged
vzh101
Groupie
Groupie
Avatar

Joined: 12 Feb 2015
Location: United States
Online Status: Offline
Posts: 46
Quote vzh101 Replybullet Posted: 01 Oct 2015 at 7:49am
Sorry let me take that back about the sorting. I sort by ApptID then by ApptDate but regardless of ApptDate being there it's sorting the same way as above.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 01 Oct 2015 at 10:35am
I would display the apptid next to the date and see if that explains it, or gives you a clear understanding of the behavior of the report.
I would then remove the apptid as a sorting function.
IP IP Logged
Printable version Printable version

Forum Jump
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