In PB 2017 R2, there is a datawindow with a date column. It is using the PFC sort. When the date column header is clicked, the rows sort as the string value of the date, not as the date value of the date. Is there a way to make it sort as a date?
In PB 2017 R2, there is a datawindow with a date column. It is using the PFC sort. When the date column header is clicked, the rows sort as the string value of the date, not as the date value of the date. Is there a way to make it sort as a date?
Hi Pete,
Maybe the PFC sort service uses the display value for sort?
There is an option of_SetUseDisplay. If the option is set AND the column edit style is DDDW, DDLB or it uses a code table the service uses the LookupDisplay funtion in sort.
HTH,
René
Date manipulation has always been a tricky thing.
In my case, I have code in the ancestor CORP layer that intercepts the SORT command and checks for DATE values. If a DATE value is found,
1. Save the current format
2. Convert the format of the date to YYYYMMDDHHMMSSFFFF
3. Sort the data
4. Convert the data back to the original format
Later -
Olan
FYI:
The code inheritance structure:
APP code <-- PFE <-- CORP <-- PFC
Hi Pete,
I'm using the sort service of PFC also. We have never experienced that problem: our columns order correctly by date.
Can you export the datawindow and post it here?
(letting us know on which column / label you click?)
regards