0 Replies Latest reply on Apr 24, 2018 10:12 AM by saileshpalav

    custom sql query

    saileshpalav

      Is there anyone who could offer some advice on how to get this working, i have created a NTA custom report

       

       

       

      SELECT FlowCorrelation.FullHostname AS Full_Hostname, FlowCorrelation.IPAddress AS IP_Address,

      SUM(NetFlowEndpoints.TotalBytes) AS SUM_of_Bytes_Transferred_Total, convert(varchar,dateadd(dd,-1,GETDATE()),112) UploadDate

       

       

      FROM NetFlowEndpoints LEFT OUTER JOIN FlowCorrelation ON (NetFlowEndpoints.IPSort = FlowCorrelation.IPAddressSort)

       

       

      WHERE (DateTime BETWEEN convert(smalldatetime,dateadd(dd,-1,convert(date,getdate()))) and convert(smalldatetime,convert(date,getdate() )) )

      AND (EXISTS(SELECT 1 FROM NetFlowSources WITH(nolock) WHERE NetFlowSources.InterfaceID=InterfaceID AND NetFlowSources.Enabled=1))

       

       

      and FlowCorrelation.FullHostname is not null and FlowCorrelation.IPAddress is not null GROUP BY FlowCorrelation.FullHostname, FlowCorrelation.IPAddress

       

       

       

       

      It is getting error message

      Msg 207, Level 16, State 1, Line 5

      Invalid column name 'IPSort'.

      Msg 207, Level 16, State 1, Line 7

      Invalid column name 'DateTime'.

      Msg 207, Level 16, State 1, Line 7

      Invalid column name 'DateTime'.

      Msg 207, Level 16, State 1, Line 3

      Invalid column name 'TotalBytes'.