|
-
Aug 7th, 2017, 01:56 PM
#1
Thread Starter
Lively Member
[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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|