Link to home
Start Free TrialLog in
Avatar of rivercem
rivercem

asked on

Manipulating Query through industrial sql

Using Wonderware's industrial sql server (MS SQL server embedded), how can we change the output format of a query result.  When we run the following query

SELECT value, datetime, tagname
FROM history
WHERE tagname = 'temperature1'
AND DateTime > '24 Mar 1998 05:00'

we get a column of "temperature1" (column name is tagname) and a column of the actual temperatures (column name is value).  We want 1 column named temperature1 with all the values.  Additionally the AS syntax does not work, nor does the CASE statement.  Wonderware has been very little help.








 
ASKER CERTIFIED SOLUTION
Avatar of Victor Spiridonov
Victor Spiridonov
Flag of Russian Federation image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
If you want all the values of tagname = 'temperature1'
try this query.

SELECT value as 'Temperature1'
FROM history
WHERE tagname = 'temperature1'
AND DateTime > '24 Mar 1998 05:00'
if you want all the values dont check the tagname.