Using SQL Queries in charts (sparkline)

I’m trying to use an SQL query to populate the data in a sparkline chart, however I get the following error in the diagnostics viewer on the component: data$CONFIG: Config Error

My query is simply:

SELECT logged_on, baume_corr, temp_pv
FROM vwTankFermentLogData
WHERE ferment_id = {Root Container.FermentID}

The first column is the datetime (x axis), and the second two columns are data values (y axis).

How does the chart know what columns to use for what? The user manual doesn’t seem to offer much help here.

If it’s of any consequence, the date/time data type is datetime2(7).
FYIW: I converted the datetime to unix datetime and this didn’t work either.

Thanks!

Nick

Try casting the datetime2 to just datetime.

Shouldn’t it be:

SELECT logged_on, baume_corr, temp_pv
FROM vwTankFermentLogData
WHERE ferment_id = '{Root Container.FermentID}'

?

Nope, ferment id is an integer field so comparing to a string would most likely result in an error

Thanks Phil, I’ll try this in the morning (11pm here).