android - SQLite - Order by next upcoming Date (ignore year) -
I have a table of individuals, and I want to order them by the next upcoming birthday (ignoring the year). I have used the method described in this answer:
OR SQL-code: The problem is that I use any other date format. Date format is mm-DD in the answer above, I want to use DD-MM. Now my dates are like this: I want to sort it in such a way: What changes can I make in my code, What does this achieve? An easy way to store it, will be the month and day switching with the SUBSTR () function: Proper order from SUBSTR (DATE ('now') from
SELECT *, 6) & gt; SUBSTR (birthday, 6), SUBSTR (birth date, 6);
17-10-1974 03-10- 1979 29-02-1980 20-10-1993
17-10-1974 20 -10-1993 29-02-1980 03-10-1979 (Because we are 10-10-2014 / last of this date)
Comments
Post a Comment