
Listbox Sorting
Started by Neil Hunter, Aug 09 2002 11:52 AM
13 replies to this topic
#1
Posted 09 August 2002 - 11:52 AM
Hi there,
When using Date fields within a listbox, the sort order is a bit wonky. It looks like its sorting it in numeric order not date order, ie 31/07/2002 would appear before 01/08/2002 if that date column was sorted in descending order. The date field does have an external type of date on file.
Is this a proiv bug or is my code up the wall ?
When using Date fields within a listbox, the sort order is a bit wonky. It looks like its sorting it in numeric order not date order, ie 31/07/2002 would appear before 01/08/2002 if that date column was sorted in descending order. The date field does have an external type of date on file.
Is this a proiv bug or is my code up the wall ?
#2
Posted 09 August 2002 - 02:41 PM
In use a lot of List Boxes and also sort by date desending.
I want the most recent date as the first item in my list box and the oldest date as the last item.
In your example that is what you are getting.
If you want the oldest ddate first, remove decending.
My date sorts work perfect.
Are you going to move to 5.5 when it is released next month?
Bill
I want the most recent date as the first item in my list box and the oldest date as the last item.
In your example that is what you are getting.
If you want the oldest ddate first, remove decending.
My date sorts work perfect.
Are you going to move to 5.5 when it is released next month?
Bill
#3
Posted 09 August 2002 - 02:49 PM
But in your example you are probably doing it Sort/Sel logic of you listbox. I'm doing it when running the listbox, and clicking on the date column to change the sort order
Probably yes. Why you ask ? And does it link directly to a SQL database instead of ODBC ?
Probably yes. Why you ask ? And does it link directly to a SQL database instead of ODBC ?
#4
Posted 09 August 2002 - 05:07 PM
I have used both Sort/Sel and click on the date column and I get the same results.
If you are using Oracle, ProIV connectes via API. If you are using Sybase, Microsoft SQL (which is an old version of Sybase) or DB2, ProIV connects via ODBC.
Since you are using Listbox, I assume you are developing GUI. If you are, 5.5 opens up Active X controls.
We are going to use Active X for highliting default buttons, Faxing from the ProIV application, E-Mailing from the ProIV application and anything else our management can dream up.
Bill
If you are using Oracle, ProIV connectes via API. If you are using Sybase, Microsoft SQL (which is an old version of Sybase) or DB2, ProIV connects via ODBC.
Since you are using Listbox, I assume you are developing GUI. If you are, 5.5 opens up Active X controls.
We are going to use Active X for highliting default buttons, Faxing from the ProIV application, E-Mailing from the ProIV application and anything else our management can dream up.
Bill
#6
Posted 14 August 2002 - 11:00 AM
Neil, you have a sharp looking screen.
The list boxes sort on the result set. You are using the date format of day, month, year. I use month, day, year format. That is why mine works and yours does not. If you think about it, on decending, 31st day is greater than the 30th day. On ascending, the first day is lower then the second day.
The list box is initially displayed in the order it was populated.
Maybe I am crazy, but why are your dates displayed day, month, year?
Bill.
The list boxes sort on the result set. You are using the date format of day, month, year. I use month, day, year format. That is why mine works and yours does not. If you think about it, on decending, 31st day is greater than the 30th day. On ascending, the first day is lower then the second day.
The list box is initially displayed in the order it was populated.
Maybe I am crazy, but why are your dates displayed day, month, year?
Bill.
#7
Posted 14 August 2002 - 11:05 AM
ahh that would explain the difference. In South Africa we like to have the date day-month-year, and all our systems are written that way.
But still if you were sorting on a date, surely it would be better if a julian conversion to a julian date format would overcome any sorting problems ? No matter what date format you store or use.
Thanks for the compliment. You like the screen ?
But still if you were sorting on a date, surely it would be better if a julian conversion to a julian date format would overcome any sorting problems ? No matter what date format you store or use.
Thanks for the compliment. You like the screen ?
#9
Posted 14 August 2002 - 11:27 AM
Yup. Sharp screen.
I hope you are not still doing 1980's technology, ugly green screen. We are moving everything to GUI.
I will talk to Darren Rowley, from ProwIV, today and ask him about the date sort with the day, month, year format.
Darren is from the UK and may have a soultion. I think your date format is European and mine is American.
Darren gets to the office around 9 AM, Caliornia time which is 11 AM my time. Post you back with his response.
Bill
I hope you are not still doing 1980's technology, ugly green screen. We are moving everything to GUI.
I will talk to Darren Rowley, from ProwIV, today and ask him about the date sort with the day, month, year format.
Darren is from the UK and may have a soultion. I think your date format is European and mine is American.
Darren gets to the office around 9 AM, Caliornia time which is 11 AM my time. Post you back with his response.
Bill
#11
Posted 14 August 2002 - 08:49 PM
Neil, Here is the solution that Darren gave me.
1. The dates displayed in a list box numeric with Date or Date4. If you covert the date to a string, it will not sort correctly.
2. ENABLE(@EROF). This sets a bit in the Kernal that converts the date to EURO.
While I was on the phone with Darren, he tested this with their Demo Time Clock Software and he said these changes worked.
Hope this Helps.
Bill
1. The dates displayed in a list box numeric with Date or Date4. If you covert the date to a string, it will not sort correctly.
2. ENABLE(@EROF). This sets a bit in the Kernal that converts the date to EURO.
While I was on the phone with Darren, he tested this with their Demo Time Clock Software and he said these changes worked.
Hope this Helps.
Bill
#13
Posted 16 August 2002 - 06:57 AM
Neil
I have noticed this too. I get the same problem.
I put it down to a bug in ProIV sorting all date fields alpha-numerically. Of course Bill you will also encounter this problem even if you have US formatted dates because '01/01/2002' will be sorted before '12/12/2001'.
I feel sure that the conscientious guys at ProIV are busy fixing this bug as we speak.
Joseph
I have noticed this too. I get the same problem.
I put it down to a bug in ProIV sorting all date fields alpha-numerically. Of course Bill you will also encounter this problem even if you have US formatted dates because '01/01/2002' will be sorted before '12/12/2001'.
I feel sure that the conscientious guys at ProIV are busy fixing this bug as we speak.

Joseph
Reply to this topic

0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users