I am having trouble calculating the difference in the number of days between two date columns in two separate tables.
I have tried date_diff, date_between, and julianday but the error says these functions do not exist. Below is the code. Kindly assist.
SELECT created_at, cast(julianday(substr(u.createdat, 1, 10)) - julianday(substr(tb.date, 1, 10)) as ‘date difference’)
from table 1 u
join table 2 tb on u.phone = tb.phone
where u.created_at is not null