Solved

Finding an IP Address within a  range in an Access query

Posted on 2013-05-28
4
356 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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
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…

733 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