> julianday('datetime') This is the right track, but lose the quotes. You've passed the literal string "`datetime`" to the function, not the name of a column. If you had to quote the column name, you'd use double-quotes or backquotes. [See the quoting rules](https://www.sqlite.org/lang_keywords.html) for more details.