?
Solved

Finding an IP Address within a  range in an Access query

Posted on 2013-05-28
4
Medium Priority
?
365 Views
Last Modified: 2013-05-30
Hi Experts

In the example database attached I have created 2 tables, tblCentres and tblData. tblCentres has the Centre IDs and Names associated with an IP Address. tblData has an export of web browsing data.

I have managed to convert the IPAddress to a 12-digit number in qryCentres-Ranges and create a From and To range for each Centre. I have done the same for the IPAddress in qryData-Ranges.

I would like to create an output query (qryOUTPUT) which looks like the attached excel example where all data has been grouped and summed and the correct CentreID and CentreName has been inserted.

In my original Data table I have at least 100,000 records and in the Centres I have 1500+. As my dataset is large I need a solution that will process fairly quickly and not hang upon running.

Can anybody please help with a way of how to achieve this?

Thanks
darls15
IPAddress-OUTPUT.xlsx
IPRanges.accdb
0
Comment
Question by:darls15
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 29

Expert Comment

by:IrogSinta
ID: 39203417
I didn't get a chance to look at everything in your database but I just noted that you can simplify your calculation for RangeTo in qryCentres-Ranges with like this:
NewRangeTo: Format([PartIFrom],"000.") & Format([PartIIFrom],"000.") & Format([PartIIIFrom]+Choose([MyNum],63,31,15,7),"000.""255""")
MyNum: Mid([IPAddress],InStr([IPAddress],"/")+1)-17
0
 
LVL 29

Accepted Solution

by:
IrogSinta earned 2000 total points
ID: 39203695
Will this work?
IPRanges--1-.accdb
0
 
LVL 51

Expert Comment

by:Gustav Brock
ID: 39203729
Be careful with that formatting as leading zeros turn the values from decimal to octal:

http://support.microsoft.com/kb/115388

/gustav
0
 

Author Closing Comment

by:darls15
ID: 39209680
Thank you for providing the tip gustav, this is good to know.

IrogSinta, thanks for your solution. I tried it with my query & found it to be extremely slow so I created tables instead and the results are almost instant!

Thanks again for your help Experts!
0

Featured Post

Office 365 Training for Admins - 7 Day Trial

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I was prompted to write this article after the recent World-Wide Ransomware outbreak. For years now, System Administrators around the world have used the excuse of "Waiting a Bit" before applying Security Patch Updates. This type of reasoning to me …
This article describes how you can use Custom Document Properties to store settings and other information in your workbook so that they will be available the next time you open the workbook.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question