On Dec 28, 2009, at 9:29 AM, Simon Slavin wrote:
On 28 Dec 2009, at 5:06pm, Israel Brewster wrote:
Or perhaps
some other way to extract the time of a timestamp that works in all
three databases?
Sorry. Each database handles time/date information differently
(there's no SQL standard for doing it). You will fail to find one
function that returns a useful result in all three SQL engines. I
recommend that you use an agnostic way of storing your datestamps in
the database, for instance as a TEXT field in the format
yyyymmdd (if you need just a date)
hhmmss (if you need just a time)
yyyymmddThhmmss (the date, then a 'T', then the time)
All of these formats are easy to recognise and sort and index
correctly. Write library routines in your software which converts
from your programming language's date representation to and from
this representation. This way you need write just one routine and
that routine /will/ work for all three SQL engines.
Thanks for the info - I was sort of afraid of that. Yeah, I can
implement parsing in my program easily enough, I was just hoping to be
able to write a one-line SQL statement that would give me the info I
wanted (just the time in that case, although I do want both time and
date stored). Oh well.
Simon.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
-----------------------------------------------
Israel Brewster
Computer Support Technician II
Frontier Flying Service Inc.
5245 Airport Industrial Rd
Fairbanks, AK 99709
(907) 450-7250 x293
-----------------------------------------------
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users