cab_codespring
asked on
Crystal Report Is Not Sorting DateTime field
I am trying to get this Crystal report to sort the DateTime field correctly but it can't seem to sort the time right. The report is grouping by two fields, then the starttime, which when I browse it says it is a type DateTime. The sort order is the same as the grouing order, and it's grouping correctly, However I am always getting this order:
May 06, 2005 1:22:22 pm
May 07, 2005 1:32:29 pm
May 07, 2005 12:49:20 pm
May 07, 2005 1:12:20 pm
May 07, 2005 12:18:59 pm
I even tried changing the order by clause in the stored procedure of the data source, which didn't help, not that I really thought it would but I'm desperate.
May 06, 2005 1:22:22 pm
May 07, 2005 1:32:29 pm
May 07, 2005 12:49:20 pm
May 07, 2005 1:12:20 pm
May 07, 2005 12:18:59 pm
I even tried changing the order by clause in the stored procedure of the data source, which didn't help, not that I really thought it would but I'm desperate.
ASKER
Yes I did, well when I changed the group order it automatically changed the sort order.
I'm doing this in VS.NEt btw. When I right click on the details section and choose report/sort records it brings up the Record Sort Order window that shows the sort order, and it's right where it should be.
I'm doing this in VS.NEt btw. When I right click on the details section and choose report/sort records it brings up the Record Sort Order window that shows the sort order, and it's right where it should be.
You said that :
"The report is grouping by two fields, then the starttime, which when I browse it says it is a type DateTime"
What's the first two fields? And where did you put the starttime that shows incorrect sort order?
"The report is grouping by two fields, then the starttime, which when I browse it says it is a type DateTime"
What's the first two fields? And where did you put the starttime that shows incorrect sort order?
these datetimes are all in the same time zone arent they?
What are the other groups?
Is there anything in the other group headers? If not put the group name in them. You may be seeing the other groups affect your sorting.
mlmcc
Is there anything in the other group headers? If not put the group name in them. You may be seeing the other groups affect your sorting.
mlmcc
ASKER
<<<You said that :
"The report is grouping by two fields, then the starttime, which when I browse it says it is a type DateTime"
What's the first two fields? And where did you put the starttime that shows incorrect sort order?>>>
The heirarchy of this data is:
Jails: Jail 1, Jail 2 etc.
HU: Housing Units (Cell blocks) HU-1, HU-2 etc.
location: (Cells) which is on the detail line, which has a corresponding start time, (which is copied, because I use the identical field to display only the date, and then the starttime which shows the time is the same field.)
The GROUPING in the report is:
Jail Name
HU Name
StartTime
LOcationName
end time
tour id
The Sorting is identical:
Jail Name
HU Name
StartTime
LOcationName
end time
tour id
The report can be seen here:
http://meadow.no-ip.com/images/report.jpg
<A HREF="http://meadow.no-ip.com/images/report.jpg">is this how you do links here?</A>
"The report is grouping by two fields, then the starttime, which when I browse it says it is a type DateTime"
What's the first two fields? And where did you put the starttime that shows incorrect sort order?>>>
The heirarchy of this data is:
Jails: Jail 1, Jail 2 etc.
HU: Housing Units (Cell blocks) HU-1, HU-2 etc.
location: (Cells) which is on the detail line, which has a corresponding start time, (which is copied, because I use the identical field to display only the date, and then the starttime which shows the time is the same field.)
The GROUPING in the report is:
Jail Name
HU Name
StartTime
LOcationName
end time
tour id
The Sorting is identical:
Jail Name
HU Name
StartTime
LOcationName
end time
tour id
The report can be seen here:
http://meadow.no-ip.com/images/report.jpg
<A HREF="http://meadow.no-ip.com/images/report.jpg">is this how you do links here?</A>
ASKER
Time zone? The dates coming into the report are the ones I showed in the original post. A normal SQL DateTime..
ASKER
I know the problem, somebody else helped me. I needed to have iot sort the starttime by second, and not by week!!! I had to go to the Report/ChangeGroup Expert/options button and select the starttime and bel,ow set it to go by seconds. problem solved. So thanks everyone, this is my first question I have no idea how it works if I solve it myself.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
have you selected this field and added it to the sort order?
Cheers!