Code: Select all
select s.name, format(sv.value,(select digits from sensors where id=s.id)) as value
from sensors s, sensorvalues sv, packets p
where (select id from packets where packettype=2 order by timestamp desc limit 1) = p.id and sv.id=p.id and sv.sid=s.idv8.2.5 chokes on the column named "digits" if I try to put it into a TMyQuery component. As you can see, there is no column named digits in my main select. Digits is a column name in the sensors table that holds the amount of numeric precision for a given sensor.
Ok, so I quote the "digits" field in the query to try to fool your parser. Now it always returns 0 for the format precision.
Any ideas or workarounds?
Thanks!
Kevin