Create a SQL Filter Based on IP Address Range
search cancel

Create a SQL Filter Based on IP Address Range

book

Article ID: 254095

calendar_today

Updated On:

Products

IT Management Suite Client Management Suite

Issue/Introduction

You want to create a filter using SQL that will allow you to filter based on an IP address range.

Environment

Release: 8.6

Resolution

If the desire to filter on IP address range is based on the last segment of the IP address, then this is a simple approach.

The following SQL can be used to achieve this desired result of only showing computers that have an IP address between 192.168.1.25 and 192.168.1.30.  Adjust accordingly to your needs.

select _ResourceGuid
from Inv_AeX_AC_TCPIP
where [IP Address] between '172.16.1.25' and '172.16.1.30'

Another option, as noted in How to create a custom report in Inventory Solution "For IP Address, select AeX AC TCPIP table, set the condition (LIKE) 192.168.42.%. All computers with IP Addresses with 192.168.42.xxx in them will be returned."

select _ResourceGuid
from Inv_AeX_AC_TCPIP
where [IP Address] like '172.16.42.%'

All computers with IP Addresses 172.16.42.xxx in them will be returned.