5 Replies Latest reply on Oct 27, 2015 2:38 PM by njoylif

    SWQL Query resource - gives error in website but works in studio


      I am trying to get info from this query which works in studio but breaks in webpage...I think because of the where ...(select) statement

      SELECT de.ComponentStatusID, de.ColumnSchemaID, de.ColumnType, de.ColumnName, de.MaxNumericData, (SELECT StringData FROM Orion.APM.DynamicEvidence WHERE ComponentStatusID=de.ComponentStatusID and ColumnName=de.ColumnName and columnType=0 and (StringData NOT LIKE '0' and StringData is not NULL) ) as StringData FROM Orion.APM.DynamicEvidence de WHERE de.ComponentStatusID  IN (SELECT top 1 ID FROM Orion.APM.ComponentStatus where ComponentID=27154 order by TimeStamp desc) and Columntype=1

      How do I best get the "last component status ID" from one table and apply to where clause of select on another table for the web?