473,387 Members | 1,742 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Help building a simple query from two tables, limited by the records in one table?

Hi,

I have searched and searched without much luck. I feel like I am doing the right thing, just not getting the right result, so here goes.

I have 2 tables. One has about 100,000 records which includes some unique and some repeated and some null data.

The other table about 136 records with similar data.

The only field that matches between the two tables is "Physical Address 1" from Table 1, and "Address Line 2" from table 2.

What I want is to create a query that shows me the 136 records from Table 2 plus the matching data from Table 1, but only for those records with the same address as specified in those fields.

I have made a relationship between the two fields and the result is I get 100,000 records with the data from Table 2 repeated again and again. Not helpful and confusing the heck out of me. I've tried different relationships, and my other databases with relationships have worked the way I expect. Sorry, but I've searched these forums and google and nothing seems to show me how to do this simple thing.

I'm using access 2002 on XP and both databases as flat. When I tried to use the analyzer on Table 1 I got an error about MaxLocksPerFile and had to stop. Could this be the issue, that it's not normalised?

Thankyou, I hope you can help
Aug 8 '07 #1
2 1574
abolos
65
Hi,

I have searched and searched without much luck. I feel like I am doing the right thing, just not getting the right result, so here goes.

I have 2 tables. One has about 100,000 records which includes some unique and some repeated and some null data.

The other table about 136 records with similar data.

The only field that matches between the two tables is "Physical Address 1" from Table 1, and "Address Line 2" from table 2.

What I want is to create a query that shows me the 136 records from Table 2 plus the matching data from Table 1, but only for those records with the same address as specified in those fields.

I have made a relationship between the two fields and the result is I get 100,000 records with the data from Table 2 repeated again and again. Not helpful and confusing the heck out of me. I've tried different relationships, and my other databases with relationships have worked the way I expect. Sorry, but I've searched these forums and google and nothing seems to show me how to do this simple thing.

I'm using access 2002 on XP and both databases as flat. When I tried to use the analyzer on Table 1 I got an error about MaxLocksPerFile and had to stop. Could this be the issue, that it's not normalised?

Thankyou, I hope you can help

Hi,
use the SELECT SQL command.

SELECT <field> from <table1> where Address line 1 =physical address 1

abolos
Aug 8 '07 #2
Ok, this is helping thanks. The express is right if the values were exactly the same. But I am finding they are not.

Here is what I have
Expand|Select|Wrap|Line Numbers
  1. SELECT EasyVic.*, Vic_Entities_Active_2007Aug01.SVID
  2. FROM EasyVic INNER JOIN Vic_Entities_Active_2007Aug01 ON (EasyVic.Address_Line_1 = Vic_Entities_Active_2007Aug01.Phys_Add1) OR (EasyVic.Address_Line_2 = Vic_Entities_Active_2007Aug01.Phys_Add1) OR (EasyVic.ID = Vic_Entities_Active_2007Aug01.ID)
  3. WHERE (((Vic_Entities_Active_2007Aug01.Phys_Add1)=[EasyVic].[Address_Line_2]));
  4.  
Is there a way to return a value in the same manner as "Like" or a fuzzy/partial search? Obviously, I'm working with street addresses, ignoring suburbs.

thanks

[edit]
I'm all over the place and confused. I keep getting multiple records again and again and now I can't use th design view any more...


****

To clarify what I want is to show all the records from EasyVic, plus any data that matches from EasyVic.Address_Line_1 OR EasyVic.Address_Line_2 with Vic_Entities_Active_2007Aug01.Phys_Add1 OR Vic_Entities_Active_2007Aug01.Phys_Add2, but NOT the records from Vic_Entities_Active_2007Aug01 that don't have a match.

More help please?
Aug 8 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: RDRaider | last post by:
I am having trouble with what will surely be a simple query for you experts. I have 2 tables with inventory data. IMITMIDX contains the master item info IMINVLOC contains location specific data...
18
by: Jeremy Weiss | last post by:
I'm trying to build a database that will handle the monthly billing needs of a small company. I'm charting everything out and here's what I see: table for customers sub table to track payments...
2
by: mark | last post by:
I've been working on an Access 2000 database for a couple of weeks now. I took a course in access about a year ago, a crash course, and I learned a ton, but I didn't touch Access for the year since...
20
by: Jack Schitt | last post by:
I thought I was starting to get a handle on Access, until I tried doing something useful...now I'm stuck. I have a DB with two tables - to keep it simple I'll say that one is an Employee File...
11
by: my-wings | last post by:
I think I've painted myself into a corner, and I'm hoping someone can help me out. I have a table of books (tblBooks), which includes a field (strPubName) for Publisher Name and another field...
3
by: Kenjamin.Lafayette | last post by:
Here is the scenario. I have a list of people, what building they work in, and on what days. Is there a way in access to pull up this database and have it make a list based only on the days,...
1
by: kev | last post by:
Hi folks, Firstly, Happy New Year to all. I have some problems with query pls help.I have 4 tables namely Equipment,Safety1,Safety2,Safety3. some of the fileds in each table is shown below....
47
by: Jo | last post by:
Hi there, I'm Jo and it's the first time I've posted here. I'm in process of creating a database at work and have come a little unstuck.....I'm a bit of a novice and wondered if anyone could...
7
by: bhipwell via AccessMonster.com | last post by:
Hello, I have developed an employee benefits database that currently contains over 3000 employees and 70+ companies. Having started the database as a really simple solution for our clients, the...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.