10 Replies Latest reply on Aug 8, 2017 9:01 AM by mjperkins

    Query Works in SWQL Studio But Not in Report Writer

    mjperkins

      I have been working on a report to pull the download times for the most recent downloaded running config for devices managed by NCM.

       

      I managed to come up with the following query, which worked in SWQL Studio:

       

      SELECT

        N.CoreNodeID AS "Node_ID", N.AgentIP AS "IP_Addess", N.NodeCaption AS "Node_Name",

        CA.DownloadTime AS "Download_Time", CA.LastAttemptedDownloadTIme AS "Last_Successful_Download_Time",

        SI.StatusName as "Status"

      FROM

        Cirrus.Nodes N INNER JOIN Cirrus.ConfigArchive CA ON N.NodeID = CA.NodeID

        INNER JOIN Orion.StatusInfo SI ON N.Status = SI.StatusID

      WHERE

        (CA.ConfigID = (SELECT TOP 1 CAA.ConfigID

           FROM Cirrus.ConfigArchive CAA

           WHERE CAA.NodeID = N.NodeID

           ORDER BY CAA.DownloadTime DESC)

         AND

         (CA.ConfigType = 'Running'))

      ORDER BY

        N.NodeCaption

       

      The query, however, returns "Query is not valid" when pasting it into the "Advanced Database Query" selector in the Report Writer and clicking "Preview Results."

       

      Does anyone have an idea why the query works in SWQL Studio, but fails when I try using it in a report?