SQLite does not understand SUBSTRING as a function. SUBSTR is ok