Ok, I think I’m over my head a little bit. It relates to columns, so I’ll use this thread.
Here’s what I’ve done: I have a table with 13 columns. Obviously, to populate the table I use a select query. And normally, I can then go to the Table Customizer and give new names for the columns.
But in this case, in the select statement I am using “Convert” to format the data on three columns. The data displays exactly how I want it, but I cannot assign column names. In fact, two of the three columns don’t even show up in the customizer, but they show up in the table at runtime and in the designer.
Also, if I modify the data set itself by adding columns, the columns show up in the customizer, but only until the first poll. Then they disappear again.
It most likely has something to do with how I’m handling the columns. In my MSSQL table, the three columns are called StartTime, EndTime, and ElapsedTime. The first two are DATETIME data types, and the third is an INT, populated with a DATEDIFF query (UPDATE OrderEntry SET ElapsedTime = DATEDIFF (s,starttime , endtime ) ) in an action item in FactorySQL.
In my table, I only want the time in DATETIME to display, so instead of saying "SELECT …, StartTime, … etc), I wrote “SELECT …, (select convert(varchar(10), starttime, 108)), …”. So, I’m actually converting the starttime (and endtime) to a string. For the ElapsedTime, I also convert it to a string, using “SELECT …, (SELECT CONVERT(varchar(2), ElapsedTime / 3600) + 'h ’ + CONVERT(varchar(2), ElapsedTime % 3600 / 60) + 'm ’ + CONVERT(varchar(2), ElapsedTime % 60) + ‘s’), …” to give me a 0h 0m 0s format from the INT DIFF.
The data is displayed exactly how I want it on the table, but I just can’t give labels to the columns. What am I doing wrong?
I’m deploying this upgrade of Monday, so if anyone wants to jump in with suggestions, go for it.