Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Finding an IP Address within a  range in an Access query

Posted on 2013-05-28
4
Medium Priority
?
367 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 52

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
Microsoft has changed the look and feel of Azure AD and Microsoft account sign-in pages so that you will have a more unified look and feel when moving between the two interfaces.
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 …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

610 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