Sqlite can do complex data manipulation like this but from a design perspective, if you are creating the data I would suggest that you convert the date to a number using the B4x DateTime functions and store that. You can the reconvert it for display and sorting and searching becomes simple and fast.
My favorite way to store dates without time is this format; yyyymmdd or maybe: yyyy-mm-dd. You can sort asc, desc without any further manipulations. When you see the date, you can easily recognize it as a date. Some in the forum prefer ticks as in B4X Datetime functions. You tell me which one of the following looks like a date when you look at it:
the ticks: 1538798400000 or 20181006. For me it is a no-brainer, the second one. But people have different preferences and reasons.
Sqlite can do complex data manipulation like this but from a design perspective, if you are creating the data I would suggest that you convert the date to a number using the B4x DateTime functions and store that. You can the reconvert it for display and sorting and searching becomes simple and fast.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.