Skip to content
Advertisement

Capturing year of a DATE in SQL Worksheet (Datameer)

In Datameer, how do you capture the year of a DATE column in a SQL worksheet?

This query

is returning the following error: 

“Encountered ‘AS YEAR’… was expecting one of: “ORDER” … “LIMIT” … “OFFSET” … “FETCH” … “FROM” … “,” … “AS” … “AS” … “AS” … “AS” … “AS” … “UNION” … “INTERSECT” … “EXCEPT” … “MINUS” … “NOT” … “IN” … “<” … “<=” … “>” … “>=” … “=” … “<>” … “!=” … “BETWEEN” … “LIKE” … “SIMILAR” … “+” … “-” … “*” … “/” … “%” … “||” … “AND” … “OR” … “IS” … “MEMBER” … “SUBMULTISET” … “CONTAINS” … “OVERLAPS” … “EQUALS” … “PRECEDES” … “SUCCEEDS” … “IMMEDIATELY” … “MULTISET” … “[” … “FILTER” … “OVER” …”

Advertisement

Answer

Try aliasing the YEAR() call to something other than YEAR, and also try repeating the function call in the GROUP BY clause:

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement