473,396 Members | 2,002 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,396 software developers and data experts.

Duplicate responses to query

3
I'm using Access 2007 on windows vista. Intel T7400 with 2.16 GHz and 2 gigs of ram. 64 bit os.

If I run a query that goes across multiple tables, I get sensible results. However, if I run a query in only one table, I get duplicate results. In fact I get over 300 repetitions of each result. This only occurs when I use multiple fields. The database I'm using is a large collection of info on boating accidents. I was trying to get a list of all prop injuries and their ages so I used field1=accident report number, field 2=prop injury with criteria="yes" and field 3 as age in my query. I got over 300 repetitions of each accident(duplicates of the accident report number) in my results. 368 to be exact

SELECT DECSEDCGAll.[Accident Report No#], DECSEDCGAll_1.[Prop Injury], DECSEDCGAll_2.[Age of Victim]
FROM DECSEDCGAll, DECSEDCGAll AS DECSEDCGAll_1, DECSEDCGAll AS DECSEDCGAll_2
WHERE (((DECSEDCGAll_1.[Prop Injury])="yes"));

I really have no idea why this happens.

As I said, this doesn't seem to be a problem if I query accross tables. For example if I use field 1) prop injuries with criteria=-1 from the deceased table and field 2) vessel length from the vessel table, I get a nice table of all the different vessel lengths with no duplicates!

help?

Stephen




Help?

Thanks,
Stephen
Jun 26 '07 #1
3 2005
MMcCarthy
14,534 Expert Mod 8TB
Hi Stephen,

You are getting multiple results because you haven't created any join relationship between your instances of the table. Therefore you are getting every combination of possible results.

Why do you need three instances of the table?

Does this not give you the result you want, if not why?

Expand|Select|Wrap|Line Numbers
  1.  
  2. SELECT [Accident Report No#], [Prop Injury], [Age of Victim]
  3. FROM DECSEDCGAll
  4. WHERE ((([Prop Injury])="yes"));
Jun 29 '07 #2
sar68
3
Thanks, I realized my error after a couple decent nights of sleep!
Jun 30 '07 #3
MMcCarthy
14,534 Expert Mod 8TB
Thanks, I realized my error after a couple decent nights of sleep!
Isn't that always the way :)
Jun 30 '07 #4

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

Similar topics

3
by: Giloosh | last post by:
Hello, i need some help if possible... i have a payments table with over 500 records i want to run a query that searches through the table spotting out any duplicate ID#'s and Dates. So basically...
4
by: medhanush | last post by:
I have data in table as follows, Num Category ProductName ---- -------- ----------- 100 A Product1 100 B Product1 101 A Product2 101 B Product2 101 A Product2
2
by: ms | last post by:
Access 2000: I am trying to delete duplicate records imported to a staging table leaving one of the duplicates to be imported into the live table. A unique record is based on a composite key of 3...
5
by: Jermin | last post by:
Hi, I have a database composed of a single table composed of 2 columns, an auto-numbered ID column and a column which contains 30 million random numbers. All I want to Access to do is check the...
6
by: sara | last post by:
I have a procedure to automate bringing several Excel files into our Access tables, on a daily basis. The problem is that if the user has a problem, and tries to run the import again (maybe 3...
3
by: skennd | last post by:
Here's my problem in exact replication: I have used the find duplicate query in Access, and the query determined the following duplicate values by the following query: In (SELECT FROM As...
5
by: Manish | last post by:
The topic is related to MySQL database. Suppose a table "address" contains the following records ------------------------------------------------------- | name | address | phone |...
8
by: Iona | last post by:
Hi Allan, I'm using a nifty piece of code you put on here some time back to do a duplicate entry check as below. I'm using to check for duplicate names. However I am getting an error message on...
4
by: ramdil | last post by:
Hi All I have table and it have around 90000 records.Its primary key is autonumber field and it has also have date column and name, then some other columns Now i have problem with the table,as my...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.