It would seem that you can only change the value of existing query fields
not:
- create a new query
- add a new column
Is this the case?
<cfscript>
try {
qryPeople = queryNew("name,dob","varchar,date",[["Susi", CreateDate(1970,1,1)],["Urs",CreateDate(1995,1,1)],["Fred", CreateDate(1960,1,1)],["Jim", CreateDate(1988,1,1)]]);
// map dob to age
qryPeopleAge = qryPeople.map(function(row, rowNumber, qryData){
row['age'] = DateDiff('yyyy', row.dob, Now());
dump(var=row, abort=false);
return row;
});
dump(var=qryPeopleAge, label='map() - map dob to age');
} catch (any error) {
dump(var=error, abort=true);
}
</cfscript>