I can query a queue like below, which works as expected.
query("SELECT time, value, time + 10 AS time_2 FROM $1 Queue", node("MyQueue>stats/stats_content/history", model()) ); dumpquery(reftable("querydump"), 1);
This works as expected, and I can apply a formula to one of the outputs to calculate something on the fly.
Now I want to get the formatted time in the answer instead of the query, by applying the formula:
convert(<time>,MODEL_TIME,DATETIME_STR)
How can I do that?
I tried
query("SELECT convert(time,MODEL_TIME,DATETIME_STR) AS formatted_time, value FROM $1 Queue", node("MyQueue>stats/stats_content/history", model()) );
And:
query("SELECT $2 AS formatted_time, value FROM $1 Queue", node("MyQueue>stats/stats_content/history", model()),convert($iter(1),MODEL_TIME,DATETIME_STR));
But I can't get the correct reference to the time column.