lundi 14 mars 2016

find values between two dates sqlite

I have three columns:

name    date          date1
----    ----          -----
john    2016-01-10    2016-01-15
jack    2016-01-20    2016-01-15

In column 'name', there are names, in column 'date' are variable dates and in date1 are fixed dates.

I am trying to find dynamic solution which would select all names within particular period, let's say 14 days.

If i choose this code:

SELECT name FROM mytable WHERE date BETWEEN date1 AND '2016-01-19';

I would get a right answer, but I am looking to find an option how to dynamicaly select '2016-01-19' with fixed 14 day change.

I hope I am not confusing too much.

Aucun commentaire:

Enregistrer un commentaire