06.05.2016, 10:47
Hi Edgars,
I think we can but i don't know how to convert hex to dec in a sql query
If i use decimal it works perfect:
result = db:getall('SELECT AVG(id) FROM objects WHERE tagcache LIKE "%AVG%"')
log(result[1]['AVG(id)'])
but for hex yow would do some extra like:
result = db:getall('SELECT AVG(CONVERT(INT,datahex)) FROM objects WHERE tagcache LIKE "%AVG%"')
log(result[1]['AVG(datahex)'])
But above is not correct...
BR,
Erwin
I think we can but i don't know how to convert hex to dec in a sql query
If i use decimal it works perfect:
result = db:getall('SELECT AVG(id) FROM objects WHERE tagcache LIKE "%AVG%"')
log(result[1]['AVG(id)'])
but for hex yow would do some extra like:
result = db:getall('SELECT AVG(CONVERT(INT,datahex)) FROM objects WHERE tagcache LIKE "%AVG%"')
log(result[1]['AVG(datahex)'])
But above is not correct...
BR,
Erwin