You're right in your assumption that CFWheels does not allow SQL functions in the where
argument. It parses the string for property names so it can map them to columns in the database, and it also applies <cfqueryparam>
bindings to the values passed in. But it is unable to parse out calls to SQL functions.
However, you can create a calculated property based on the SQL function that you need and query against that.
In models/PriceList.cfc
:
function init() {
property(name="startDateYear", sql="YEAR(pricelists.startdate)";
}
In your findAll
call:
currencyInfo = model('pricelist').findAll(select="currencyid,name", where="startDateYear=#params.year#");