大多数 IP 数据库都包括“起始 IP 范围”和“结束 IP 范围”列。这些列中的值通常为 8 位整数。您的数据可能有由句点分隔的 9 位数字字符串形式的 IP 地址。例如,1.23.456.789。若要确定 IP 地址的位置,您需要将 IP 地址转换为整数,并确定该地址存在于哪个 IP 范围内。
首先,您将需要在 IP 地址数据和 IP 地址数据库之间创建两个联接。(INT(
LEFT([IP 地址],(FIND([IP 地址], ".")))
))*16777216+
(INT(
LEFT(
MID([IP 地址],
FIND([IP 地址],".")+1),
FIND(MID([IP 地址],FIND([IP 地址],".")+1),".")-1)
))*65536+
(INT(
MID([IP 地址],
FIND([IP 地址], ".", FIND([IP 地址], ".") +1)+1,
(FIND([IP 地址], ".", FIND([IP 地址], ".", FIND([IP 地址],"." ) +1) +1)) - (FIND([IP 地址], ".", FIND([IP 地址], ".") +1))-1
)
))*256+
(INT(
RIGHT([IP 地址],
LEN([IP 地址]) -
FIND([IP 地址], ".", FIND([IP 地址], ".", FIND([IP 地址],"." ) +1) +1)
)(INT(
LEFT([IP 地址],(FIND([IP 地址], ".")))
))*16777216+
(INT(
LEFT(
MID([IP 地址],
FIND([IP 地址],".")+1),
FIND(MID([IP 地址],FIND([IP 地址],".")+1),".")-1)
))*65536+
(INT(
MID([IP 地址],
FIND([IP 地址], ".", FIND([IP 地址], ".") +1)+1,
(FIND([IP 地址], ".", FIND([IP 地址], ".", FIND([IP 地址],"." ) +1) +1)) - (FIND([IP 地址], ".", FIND([IP 地址], ".") +1))-1
)
))*256+
(INT(
RIGHT([IP 地址],
LEN([IP 地址]) -
FIND([IP 地址], ".", FIND([IP 地址], ".", FIND([IP 地址],"." ) +1) +1)
)
))001458025
40 KB
60 KB

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.