Re: [sqlite] Is this date supposed to be less than or more than the other?

2015-01-03 Thread J Decker
On Sat, Jan 3, 2015 at 5:23 AM, Simon Slavin wrote: > > On 3 Jan 2015, at 1:12am, J Decker wrote: > > > On Fri, Jan 2, 2015 at 4:44 PM, Simon Slavin > wrote: > > > >> On 3 Jan 2015, at 12:12am, J Decker wrote: >

Re: [sqlite] Is this date supposed to be less than or more than the other?

2015-01-03 Thread Simon Slavin
On 3 Jan 2015, at 1:12am, J Decker wrote: > On Fri, Jan 2, 2015 at 4:44 PM, Simon Slavin wrote: > >> On 3 Jan 2015, at 12:12am, J Decker wrote: >> >>> https://www.sqlite.org/datatype3.html /* lists DateTime as a distinct >>> type */

Re: [sqlite] Is this date supposed to be less than or more than the other?

2015-01-02 Thread Igor Tandetnik
On 1/2/2015 4:54 PM, J Decker wrote: select * from messages where received < datetime( 'now', '-3600' ) datetime( 'now', '-3600' ) returns NULL; the second parameter is not a valid modifier string. Most comparisons with NULL values report false. -- Igor Tandetnik

Re: [sqlite] Is this date supposed to be less than or more than the other?

2015-01-02 Thread James K. Lowden
On Fri, 2 Jan 2015 16:12:23 -0800 J Decker wrote: > I understand it's kept as a string... It might be more helpful to think of it not in terms of how it's "kept" but as what its type is. How it's kept is up to the DBMS to decide. But the column is of a type: one of text,

Re: [sqlite] Is this date supposed to be less than or more than the other?

2015-01-02 Thread J Decker
On Fri, Jan 2, 2015 at 4:44 PM, Simon Slavin wrote: > > On 3 Jan 2015, at 12:12am, J Decker wrote: > > > https://www.sqlite.org/datatype3.html /* lists DateTime as a distinct > type > > */ > > No it doesn't. It says that if you try to define a column as

Re: [sqlite] Is this date supposed to be less than or more than the other?

2015-01-02 Thread Keith Medcalf
The datetime() function takes an argument which represents a date and time string. The magic string 'now' equates to the computers concept of the current GMT time. This string, unless an additional modification is applied via the 'localtime' modifier, is always returned as a timestring in

Re: [sqlite] Is this date supposed to be less than or more than the other?

2015-01-02 Thread Simon Slavin
On 3 Jan 2015, at 12:12am, J Decker wrote: > https://www.sqlite.org/datatype3.html /* lists DateTime as a distinct type > */ No it doesn't. It says that if you try to define a column as DATETIME SQLite will understand it as you wanting a column with NUMERIC affinity. >

Re: [sqlite] Is this date supposed to be less than or more than the other?

2015-01-02 Thread J Decker
On Fri, Jan 2, 2015 at 4:29 PM, Simon Davies wrote: > On 3 January 2015 at 00:12, J Decker wrote: > > Okay... > > https://www.sqlite.org/lang_datefunc.html > > > > https://www.sqlite.org/datatype3.html /* lists DateTime as a distinct > type > > */

Re: [sqlite] Is this date supposed to be less than or more than the other?

2015-01-02 Thread Simon Davies
On 3 January 2015 at 00:12, J Decker wrote: > Okay... > https://www.sqlite.org/lang_datefunc.html > > https://www.sqlite.org/datatype3.html /* lists DateTime as a distinct type > */ Could you point out where exactly > > I understand it's kept as a string... and there's no

Re: [sqlite] Is this date supposed to be less than or more than the other?

2015-01-02 Thread J Decker
Okay... https://www.sqlite.org/lang_datefunc.html https://www.sqlite.org/datatype3.html /* lists DateTime as a distinct type */ I understand it's kept as a string... and there's no internal functions for this... but wasn't there a discussion to add hex and octal etc support for number

Re: [sqlite] Is this date supposed to be less than or more than the other?

2015-01-02 Thread Clemens Ladisch
J Decker wrote: > is this... 2015-01-02 20:47:18 (this is datetime( 'now', '-3600 second' ) > > received = 2015-01-02 13:46:23.818-0800 this is a DATETIME column recorded > in the database SQLite has no DATETIME datatype. This is just a string. > select * from messages where received <

[sqlite] Is this date supposed to be less than or more than the other?

2015-01-02 Thread J Decker
is this... 2015-01-02 20:47:18 (this is datetime( 'now', '-3600 second' ) received = 2015-01-02 13:46:23.818-0800 this is a DATETIME column recorded in the database recieved2 = 2015-01-02 15:46:20.000-0600 this is a DATETIME column recorded in the database 13- (-8) = 21 which is more than NOW