Solved

Finding an IP Address within a  range in an Access query

Posted on 2013-05-28
4
359 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 500 total points
ID: 39203695
Will this work?
IPRanges--1-.accdb
0
 
LVL 50

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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

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 to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
The viewer will learn how to  create a slide that will launch other presentations in Microsoft PowerPoint. In the finished slide, each item launches a new PowerPoint presentation and when each is finished it automatically comes back to this slide: …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

691 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