Sqlite Date?

If you need help with a project or need to know how to do something specific in VB.NET then please ask your questions in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
4 posts Page 1 of 1
Contributors
User avatar
Dummy1912
VIP - Donator
VIP - Donator
Posts: 1969
Joined: Sat Aug 21, 2010 2:17 pm

Sqlite Date?
Dummy1912
Hello,

can anyone help me out
i want to show the date ordering? from small value to higher value

but i get it like this image :(

i used:
Code: Select all
Dim empls As SQLiteDataReader = DataBase.executeQuery("SELECT " & attributes & " FROM transactions " & fromClause & " WHERE " & whereClause & " ORDER BY transactions.sdate ASC;")
sdate looks like: 3/6/2017 ' month day year
Image

please :)

Thanks
visit us on:


http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
User avatar
CodenStuff
Site Admin
Site Admin
Posts: 4389
Joined: Tue Aug 04, 2009 1:47 am

Re: Sqlite Date?
CodenStuff
Are you storing it as a date/time or string value?

You should really be saving dates and times as a date/time stamp.
Welcome to CodenStuff.com Learn Code, Love Code. Thank you for being a member of the community.
User avatar
Dummy1912
VIP - Donator
VIP - Donator
Posts: 1969
Joined: Sat Aug 21, 2010 2:17 pm

Re: Sqlite Date?
Dummy1912
Hello,

just as a string.

and why as a date time value?
is there a reason for.
visit us on:


http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
User avatar
CodenStuff
Site Admin
Site Admin
Posts: 4389
Joined: Tue Aug 04, 2009 1:47 am

Re: Sqlite Date?
CodenStuff
Just storing it as a date or date/time stamp is easier to sort. It would make your life a lot easier when pulling information from the database :)

This may help you with information on storing dates: https://www.sqlite.org/lang_datefunc.html
Welcome to CodenStuff.com Learn Code, Love Code. Thank you for being a member of the community.
4 posts Page 1 of 1
Return to “Coding Help & Support”