While learning SQL in my course, I have used the function YEAR(Start_Time) AS Year
Start_Time
is a column header. The date time example is in this format: 26/12/2017 09:00:00
YEAR()
function works in SQL.
However, when I went on SQLite (on DB Browser), the function is not working. I used the strftime('%Y', 'Start_Time')
. I understand that strftime goes from left to right. Does anyone know what would be the equivalent function to YEAR()
in sqlite with the date time format given above?
In SQL:
YEAR(Start_Time) AS Year
Answer:
2017
In sqlite:
YEAR(Start_Time)
Answer:
function not recognized
strftime('%Y', 'Start_time')
Answer:
function not recognized