Results 1 to 31 of 31

Thread: [RESOLVED] How To Set Records Order According To This Kind of Field?

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Dec 2015
    Posts
    103

    Resolved [RESOLVED] How To Set Records Order According To This Kind of Field?

    So I want to sort my records according to tglabsen, in descending order. This field is in Varchar, I know I probably should set it as DATE, but DATE type gave me an error, so i changed it to varchar, and my database is running okay with it.
    Here is one example of what the value of this field looks like :

    31/07/2017

    I tried :

    "select * from absen where NIP='xxxxx' order by tglabsen desc"

    But what happened is that the record was sorted according to the first 2 digit number in the value.

    So, instead of setting value like 8/8/2017 on top, the program put 31/07/2017 on top. Because 31 is bigger than 8. Any idea to solve this? will it be better to change the tglabsen to DATE type?
    Last edited by xboner; Aug 7th, 2017 at 05:44 PM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width