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?
- You are here:
- Home
- Q&A
- Q&A
- PowerBuilder
- Datawindow Date Sort
- Pete Yankovich
- PowerBuilder
- Friday, 25 September 2020 13:41 PM UTC
- Monday, 28 September 2020 05:31 AM UTC
- PowerBuilder
- # 1
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é
- Saturday, 26 September 2020 16:12 PM UTC
- PowerBuilder
- # 2
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
- Olan Knight
- Monday, 28 September 2020 14:27 PM UTC
-
Helpful Loading... Helpful 0
- John Fauss
- Monday, 28 September 2020 15:56 PM UTC
if Mid(ls_datatype,1,4) = 'date' then
-
Helpful Loading... Helpful 0
- Friday, 25 September 2020 14:14 PM UTC
- PowerBuilder
- # 3
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
- Miguel Leeuwe
- Saturday, 26 September 2020 23:36 PM UTC
-
Helpful Loading... Helpful 0
- Miguel Leeuwe
- Saturday, 26 September 2020 23:37 PM UTC
-
Helpful Loading... Helpful 0
- Page :
- 1
However, you are not allowed to reply to this question.