groupBy() Variable QUERY is undefined

According to the docs 9.4.0, an Expression can be passed in place of a column for .groupBy().

When I try this:

.groupBy( query.raw( "DATEPART(mm, a.projected_install), a.project_type") )

I get: Variable QUERY is undefined.

What am I missing?

ColdBox: 6.9.0+9
qb: 9.4.1 SQLGrammer: SQLServer

query isn’t magically available. That is referencing whatever builder variable you already have. The result of getInstance( "QueryBuilder@qb" )

1 Like

Well, that makes too much sense :joy:
Thanks Eric.