I have simple SQL to calculate the number of weeks in my SQLite reports
SELECT STRFTIME('%W', 'date_column')
This was correct for 2009-2012. In 2013, I always had the wrong week number.
for instance
SELECT STRFTIME('%W', '2012-02-28')
return '09' and that is correct.
SELECT STRFTIME('%W', '2013-02-28')
return '08' and this is wrong. We have the 9th week.
Is there anything in SQLite date date functions that I don't understand? Or is it a SQLite error?
source
share