Re: [sqlite] Better way to get range of dates

2018-08-29 Thread Cecil Westerhof
2018-08-30 8:13 GMT+02:00 Keith Medcalf : > > Slightly more efficient code is generated for the BETWEEN version (the LHS > of the between is only calculated once). It is also somewhat easier to > read. > That is the primary reason to use BETWEEN, but it does not hurt that it is more efficient. ;

Re: [sqlite] Better way to get range of dates

2018-08-29 Thread Keith Medcalf
ailinglists.sqlite.org] On Behalf Of Cecil Westerhof >Sent: Wednesday, 29 August, 2018 23:53 >To: SQLite mailing list >Subject: [sqlite] Better way to get range of dates > >When getting data between a range of dates you can use: >WHERE date >= DATE('now', '-7

[sqlite] Better way to get range of dates

2018-08-29 Thread Cecil Westerhof
When getting data between a range of dates you can use: WHERE date >= DATE('now', '-7 days') AND date < DATE('now') or: WHERE date BETWEEN DATE('now', '-7 days') AND DATE('now', '-1 days') Is there a preferred way? In a way I like the second b