Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How Can I Do a Range Lookup in Access 2010? 1

Status
Not open for further replies.

thebluesdog

IS-IT--Management
Jan 12, 2012
4
US
I have two tables. One table contains starting and ending IP address ranges, along with the associated county name for each range. The second table has a computer name, and an IP address. I want to be able to use the computer's IP address, to look up the IP range, to get the name of the county that the computer is located in. In EXCEL, I used the LOOKUP function, but this function doesn't appear to be in Access. Does anyone have a suggestion? Thank you.
 
In SQL you typically use the BETWEEN operator.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
PHV-Thanks for your quick respnose. Below is the expression I have in my query. My result says #ERROR.

County Name: DLookUp("[county]","[t ip boundaries]",[t inventory from ip lookup].[ip address] & " BETWEEN [range begin] And [range end]")


 
I'd try this if [ip address] is not numeric:
County Name: DLookUp("[county]","[t ip boundaries]",[tt][!]"'" & [/!][/tt][t inventory from ip lookup].[ip address] & "[tt][!]'[/!][/tt] BETWEEN [range begin] And [range end]")

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top