i have this in my Sqllite Database query, i want ...
select BoardingDate, strftime('%Y', date(BoardingDate)) from Hostels;
but in the output it renders BoardingDate
correctly and the output
BoardingDate Month
-------------------------
8/1/2007 0:00:00 null
3/1/2008 0:00:00 null
8/1/2008 0:00:00 null
3/1/2009 0:00:00 null
These is the current behaviour of the queries
1. strftime('%Y', date('now')) - outputs correctly
2. strftime('%Y', date('2020-03-06')) - it works also
3. strftime('%Y', date(BoardingDate)) - Gives an error, it doesnt render at all..
4. strftime('%Y', date(Hostels.BoardingDate)) - The same error...
5. strftime('%Y', datetime(BoardingDate)) - Gives an error,
6. strftime('%Y', datetime(Hostels.BoardingDate)) - doesnt work....
it prints the string, i dont know why. its working this way.
i'm trying to calculate the date using the julianday()
function but thats a longer approach
i'm just confused right now. thanks.
This is the error i get in the Message Panel
select BoardingDate, strftime('%Y',BoardingDate)
> no such column: BoardingDate
> Time: 0s
but the first column render correctly, but the function column returns this error I tried following the solutions on these pages but to no avail
get-month-from-datetime-in-sqlite
i have tried other functions from this documentation lang_datefunc.html but i still get the same error, when i try to pass a column reference as a parameter in a function