I’ve tried this multiple ways and I’m getting close but I fail every time. We have multiple lines that operate on a daily basis and I’m reading values from a SQL table to tell me if the line is active or not and I am trying to create a dashboard that will show a performance value if they’re active otherwise it will show them as not being active. This works in the script console:
x=system.db.runPrepQuery(“select convert(varchar(50),FORMAT(perf,‘p’)) from assy_prodlog where line = ? AND evntstart < getdate() AND evntend > getdate()”,[l])
b = 'Performance is: ’
if x.getRowCount() > 0:
print b + x.getValueAt(0,0)
print “This line is currently not active!”
Putting this in the script console works like a charm. But I’m not sure how to set this as the script on a label in perspective. I can run the SQL query from a name query but it’s also passing through a column heading with multiple quotation marks and brackets. Has anyone experienced this?