• maravig - Friday, February 24, 2017 9:56 AM

    What else do you require?  screenshots?  the Parameter settings?  My apologies, I'm a SQL coding newbie

    There's no way to know why are you not getting results. The query seems fine, but you might be missing data. Although, you have a DISTINCT and GROUP BY which shouldn't be needed anyway.
    You need to be sure that you should get results with the parameters that you're using.
    You're not using v_RA_System_IPAddresses or v_Collection so there's no reason to have them in the query unless the DB is missing Foreign Keys.


    SELECT S.Netbios_Name0 as 'Computer Name',
      N.IPAddress0 as 'IP Address',
      S.User_Name0 as 'User Name',
      U.Full_User_Name0 as 'Full User Name',
      S.AD_Site_Name0 as 'Site'
      ,M.CollectionID
    FROM v_R_System                         S
    JOIN v_R_User                           U on U.User_Name0 = S.User_Name0
    JOIN v_GS_NETWORK_ADAPTER_CONFIGURATION N on N.ResourceID = S.ResourceID
    JOIN v_FullCollectionMembership         M on M.resourceid = S.ResourceID
    where /*(M.CollectionID = @collid )
    AND */N.IPAddress0 NOT LIKE 'fe%'
    AND N.IPAddress0 NOT LIKE '%::%'
    AND N.IPAddress0 NOT LIKE '169%'
    ORDER BY S.Netbios_Name0;

    If you get any results, then use a value from CollectionID column as a parameter, remove the column and uncomment the WHERE clause.
    If you don't get any results, it's because you don't have data available.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2