Jump to content


Click the link below to see the new game I'm developing!


Photo
- - - - -

Listbox Sorting


13 replies to this topic

#1 Neil Hunter

Neil Hunter

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 420 posts
  • Gender:Male
  • Location:Johannesburg, South Africa

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 ?

#2 Bill Loven

Bill Loven

    Expert

  • Members
  • PipPipPipPip
  • 147 posts
  • Gender:Male
  • Location:Coppell, United States

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

#3 Neil Hunter

Neil Hunter

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 420 posts
  • Gender:Male
  • Location:Johannesburg, South Africa

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 ?

#4 Bill Loven

Bill Loven

    Expert

  • Members
  • PipPipPipPip
  • 147 posts
  • Gender:Male
  • Location:Coppell, United States

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

#5 Neil Hunter

Neil Hunter

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 420 posts
  • Gender:Male
  • Location:Johannesburg, South Africa

Posted 14 August 2002 - 07:33 AM

I have attached Screen captures of my listbox.

Entry is on entry to the list box
Descending is supposedly descending sort order on Tran Date
Ascending is supposedly ascending sort order on Tran Date

Attached Files



#6 Bill Loven

Bill Loven

    Expert

  • Members
  • PipPipPipPip
  • 147 posts
  • Gender:Male
  • Location:Coppell, United States

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.

#7 Neil Hunter

Neil Hunter

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 420 posts
  • Gender:Male
  • Location:Johannesburg, South Africa

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 ?

#8 Neil Hunter

Neil Hunter

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 420 posts
  • Gender:Male
  • Location:Johannesburg, South Africa

Posted 14 August 2002 - 11:08 AM

If you look at the ascending, surely the 14 of december is greater than the 15 of may ?

#9 Bill Loven

Bill Loven

    Expert

  • Members
  • PipPipPipPip
  • 147 posts
  • Gender:Male
  • Location:Coppell, United States

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

#10 Neil Hunter

Neil Hunter

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 420 posts
  • Gender:Male
  • Location:Johannesburg, South Africa

Posted 14 August 2002 - 11:35 AM

Unfortunately a lot of our clients still work on the green screen technology. Fortunately i dont have to program green screen functions

I'll await your response

#11 Bill Loven

Bill Loven

    Expert

  • Members
  • PipPipPipPip
  • 147 posts
  • Gender:Male
  • Location:Coppell, United States

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

#12 Neil Hunter

Neil Hunter

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 420 posts
  • Gender:Male
  • Location:Johannesburg, South Africa

Posted 15 August 2002 - 05:59 AM

That doesn't make sense,

because my field is defined as a numeric, with date4 as special check and it has an external type of date

#13 Joseph Serra

Joseph Serra

    Advanced

  • Members
  • PipPipPip
  • 93 posts
  • Gender:Male
  • Location:Melbourne, Australia

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

#14 Neil Hunter

Neil Hunter

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 420 posts
  • Gender:Male
  • Location:Johannesburg, South Africa

Posted 16 August 2002 - 06:59 AM

Thanks Joseph



Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Click the link below to see the new game I'm developing!