You can't use an existing field name as an alias:
SELECT P.DocStatus,C.CustomerName,P.CustomerID, YEAR(CreateDate) as createYear
needs to be
SELECT P.DocStatus,C.CustomerName,P.CustomerID, YEAR(CreateDate) as Create_Year
or something similar. Also, it looks like you are using a case-insensitive version of SQL (that isn't a criticism, just information :) )