My “task” database table look like this:
[title] [content] [start_date] [end_date]
[...] [...] [01.06.2010 20:10:36] [06.06.2010 20:10:36]
[...] [...] [05.06.2010 20:10:36] [06.06.2010 20:10:36]
And I want to find only those records that meet the condition that a given day is between start_date and end_date.
I’ve tried the following SQL expression:
SELECT * FROM task WHERE
strftime ('%d', start_date) <= @day
AND
@day <= strftime ('%d', end_date)
Where @day is an SQLiteParameter (eq 5). But no result is returned.
How can I solve this problem?
Thanks.
Seems that functions working with data and time in SQLite3 does not accept like parameter a table column. Expects only Strings. But instead you can make comparisons of data using strings.
Example:
This work for me.