Query Aliases (Select As)
Posted: 20 Oct 2006, 06:24
Having an issue with a select statement:
var sql = "SELECT AVG(total) AS averageTotal FROM Table"
var queryRes = dbase.executeQuery(sql);
var tempRow = queryRes.get(0);
var theAverage = tempRow.getItem("averageTotal")
theAverage returns null.
I can do a select that returns 1 numeric result without any problem. However, I cannot do an aliased result set in any way I have tried.
Any suggestions or thoughts?
HK
var sql = "SELECT AVG(total) AS averageTotal FROM Table"
var queryRes = dbase.executeQuery(sql);
var tempRow = queryRes.get(0);
var theAverage = tempRow.getItem("averageTotal")
theAverage returns null.
I can do a select that returns 1 numeric result without any problem. However, I cannot do an aliased result set in any way I have tried.
Any suggestions or thoughts?
HK