Reputation: 3520
Im new to sqlite3 (and databases in general for that matter). Anyway, in my database i have a date column and i wanted to get all of the data within the 3 days of the current date. Here is the query I have. I am just not sure if there is a built in way to get nearby dates in sqlite3. I dont know what to put in the '?'s.
SELECT date FROM fooTable WHERE date('now') ???????
Upvotes: 0
Views: 85
Reputation: 64700
Try this (3 days is 3*86400 seconds):
SELECT date FROM fooTable WHERE strftime('%s', now) - strftime('%s',date) < 259200
Upvotes: 1