select
comp.[Guid]
from vSubnet sub
left join vSiteSubnetMap vss on vss.[SubnetGuid] = sub.[guid]
left join vSite vs on vs.[Guid] = vss.[_ResourceGuid]
join vItem vi on vi.[guid] = sub.[Guid]
join Inv_AeX_AC_TCPIP tcp on tcp.[subnet] = sub.[Subnet]
join vComputer comp on comp.[guid] = tcp.[_ResourceGuid]
Where vs.Name like '%SITENAMEGOESHERE%'
oR
select guid from vcomputer vc
Left Join [Inv_AeX_AC_TCPIP] tcpip On vc.Guid = tcpip.[_ResourceGuid]
And tcpip.[_id] = ( Select top 1 tcpip2.[_id] From [Inv_AeX_AC_TCPIP] tcpip2
Where vc.Guid = tcpip2.[_ResourceGuid]
AND tcpip2.[IP Address] NOT IN ('127.0.0.1', '0.0.0.0', '')
AND tcpip2.[IP Address] IS NOT NULL Order By tcpip2.[IP Address] Asc
)
left join vSubnet sub on tcpip.[subnet] = sub.[Subnet]
left join vSiteSubnetMap vss on vss.[SubnetGuid] = sub.[guid]
left join vSite vs on vs.[Guid] = vss.[_ResourceGuid]
Where vs.Name like '%SITENAMEGOESHERE%'
If this works mark as solution please