jay_waugh
asked on
extract 1st threee octets from IP address
Hi can someone help please?
I have an Access database which contains a table of IP addresses.
I want to add a further column to the table which only contains the 1st three octets of the IP address.
e.g
IP Address Octet
1.1.1.1 1.1.1
172.0.1.27 172.0.1
192.168.3.1.2 192.168.3
How can this be done?
Many Thanks
Jay
I have an Access database which contains a table of IP addresses.
I want to add a further column to the table which only contains the 1st three octets of the IP address.
e.g
IP Address Octet
1.1.1.1 1.1.1
172.0.1.27 172.0.1
192.168.3.1.2 192.168.3
How can this be done?
Many Thanks
Jay
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
In one line:
IpAddress = "192.168.3.12"
Octet3 = StrReverse(Split(StrReverse(IpAddress), ".", 2)(1))
Octet3 -> "192.168.3"
/gustav
pls try
Open in new window
Regards