I try to format the date in a query, but I got an error whentrying to extract the year, the month...
This occurs on sqlLite and Postgres.
Django version : 1.11.4
>>> users = User.objects.all()
>>> users.annotate(year=Cast(ExtractYear('date_joined'), CharField()))
return Database.Cursor.execute(self, query, params)
sqlite3.OperationalError: near "None": syntax error