Sorting a report by timestamp
652458Dec 9 2008 — edited Dec 9 2008Okay folks, this is either a bug or I'm being rather daft again
I have a region displaying a report which can be sorted in a variety of fields. The resulting table sorts fine for all columns but one, a date column of type %timestamp. Before anyone asks, I don't use %date because I want to record the time too. The link and arrows appear on the column but no sorting is actually happening. So here's a selection of things I tried to no avail:
1. Format the column at the Region definition with the to_char() function (to_date strips off the time for some reason)
2. Determine the format [DD-MON-YYYY HH24:MI:SS] at the Report attributes level
3. Removing all formatting
A few odd things that happen are:
1. This column at one point had a sort sequence determined. Now if you remove it, it'll still select this column by default, and there is no "order by" definition in the sql source.
2. If you remove this column altogether and try to define another column with a sort sequence, this new column won't appear as the default ordered by column.
3. If I run the query in the SQL Commands window and explicitly specify an "order by" then it orders fine, whether I format the column or not.
I'm suspecting an Apex bug at this point but if anyone had the same sort of issue and can suggest some easy workaround, I'm all ears. As I said I might just be dumb.
Cheers