Strange mysql date problem

Post

Posted
Rating:
#1 (In Topic #1047)
Regular
bill-lancaster is in the usergroup ‘Regular’
ORDER BY date seems not to be working.

Code

  hResult = hConn.Find("transactions", "ORDER BY TransDate")

produces:-<LIST>
  • <LI>27/01/0022 00:00:00
    27/01/0022 00:00:00
    31/01/0022 00:00:00
    31/01/0022 00:00:00
    01/12/2021 00:00:00
    01/12/2021 00:00:00
    01/12/2021 00:00:00
    01/12/2021 00:00:00
    01/12/2021 00:00:00
    01/12/2021 00:00:00
    01/12/2021 00:00:00
    01/12/2021 00:00:00</LI>
</LIST>

The first four records are out of sequence, the remainder are all correct.

The first four records are the most recent addition to the database so perhaps something has changed in Gambas3 or in mysql
Gambas v3.18.2
mysql  Ver 8.0.33-0ubuntu0.22.04.2

This is a worrying failure of a basic function so any ideas would be appreciated.
Online now: No Back to the top

Post

Posted
Rating:
#2
Avatar
Administrator
gbWilly is in the usergroup ‘unknown’

bill-lancaster said


produces:-<LIST>
  • <LI>27/01/0022 00:00:00
    27/01/0022 00:00:00
    31/01/0022 00:00:00
    31/01/0022 00:00:00
    01/12/2021 00:00:00
    01/12/2021 00:00:00
    01/12/2021 00:00:00
    01/12/2021 00:00:00
    01/12/2021 00:00:00
    01/12/2021 00:00:00
    01/12/2021 00:00:00
    01/12/2021 00:00:00</LI>
</LIST>

The first four records are out of sequence, the remainder are all correct.
I see a correct order as the year 22 is way before 2021.
I guess you wanted the year 2022 instead of 22, but put in the wrong year.  ;)

gbWilly
- Gambas Dutch translator
- Gambas wiki content contributor
- Gambas debian/ubuntu package recipe contributor
- GambOS, a distro for learning Gambas and more…
- Gambas3 Debian/Ubuntu repositories


… there is always a Catch if things go wrong!
Online now: No Back to the top

Post

Posted
Rating:
#3
Regular
bill-lancaster is in the usergroup ‘Regular’
 Thank you gbWilly, panic over.  I think a visit to the opticians might be in order!
Online now: No Back to the top
1 guest and 0 members have just viewed this.