Solved

Finding an IP Address within a  range in an Access query

Posted on 2013-05-28
4
344 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
  • 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 49

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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
Technology opened people to different means of presenting information, but PowerPoint remains to be above competition. Know why PPT still works today.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …

758 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now