I’m trying to obtain the current week for date comparison in SQLite.
I have no problem for last month, last year, today, yesterday… but don’t find the solution to have the current week.
I tried lot of things like:
SELECT tastings.* FROM tastings
WHERE (DATE(tastings.date) > DATE('now','weekday 1','+ 7 days'))
Can you help me ? Thanks.
What is stored inside the
tastings.datecolumn? Note that SQLite does not have “timestamp” type affinity, so probably you store Text (some representation of the date) or integer (julian day, epoch…)All time and date functions expect a valid time string and convert that time string to another string format. If
tastings.datecontains a week number then use: