473,396 Members | 1,738 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.

1:M with queries

This may be a dumb question, but can you create a 1:M relationship with
queries instead of tables? thanks!

Nov 13 '05 #1
5 1249
ki**************@gmail.com wrote:
This may be a dumb question, but can you create a 1:M relationship with
queries instead of tables? thanks!


The relationships are always between tables not queries.

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
Nov 13 '05 #2
ki**************@gmail.com wrote:
This may be a dumb question, but can you create a 1:M relationship with
queries instead of tables? thanks!


Relationships are always between tables. What are you trying to do?

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
Nov 13 '05 #3
Well, I bought a whole bunch of Access Database books and I couldn't
find the answer in any of them. I got what I needed to do, which is to
create a 1:M relationship with two tables, but I was hoping to use my
queries because the databases I wanted to use had some null values in
the fields I wanted to join on the many side and so I had ended up
filtering out the nulls and recreating tables. It was kind of a pain.

Nov 13 '05 #4
ki**************@gmail.com wrote:
Well, I bought a whole bunch of Access Database books and I couldn't
find the answer in any of them. I got what I needed to do, which is to
create a 1:M relationship with two tables, but I was hoping to use my
queries because the databases I wanted to use had some null values in
the fields I wanted to join on the many side and so I had ended up
filtering out the nulls and recreating tables. It was kind of a pain.


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

If you just want to show all the rows in the ONE table try a LEFT JOIN
query. The the table w/ the ONE relationship on the LEFT side and the
many relationship on the right side. E.g.:

SELECT one_table.column, <column list>
FROM one_table LEFT JOIN many_table
ON one_table.join_column = many_table.join_column
WHERE < criteria>

This should return all rows in the left table and all rows in the right
table. Those rows in the right table that don't have a value in the
join_column will not have anything (NULL).

Perhaps if you stated your goal we could help you better.

Also, a good read of a decent database design book would be in order. I
usually recommend _Database Design for Mere Mortals_ by Hernandez.
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQls42oechKqOuFEgEQIx8ACfUkB2Cbuev65gggrYZ/5uBa9dHD8An2gP
UUdrwT1ZS5nsZyRDHIFtVcZ0
=i7Fq
-----END PGP SIGNATURE-----
Nov 13 '05 #5
Kimberly,
It's not a dumb question. The word relationships is used in Access to refer
to two different things. I think this confuses some people--it confused me
for a while. There are constraints that limit what can be added to a table
based on a value stored in another table. These are called referential
integrity relationships and are what you set up in the Relationships Window
when you enable referential integrity for a relationship. Joins are
instructions in a query to match values in one or more columns in two
different tables or queries and return any rows in the result that have
matches. An INNER join requires that the values in the contributing
tables/columns match. An OUTER join (LEFT, RIGHT or FULL) return all the
rows in one table or query and allow nulls in the column being matched.
From your other posts it sounds like what you need is to do an OUTER join in
your query.
--
Alan Webb
kn*******@SPAMhotmail.com
"It's not IT, it's IS"

<ki**************@gmail.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
This may be a dumb question, but can you create a 1:M relationship with
queries instead of tables? thanks!

Nov 13 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Andreas Lauffer | last post by:
I changed from Access97 to AccessXP and I have immense performance problems. Details: - Access XP MDB with Jet 4.0 ( no ADP-Project ) - Linked Tables to SQL-Server 2000 over ODBC I used...
5
by: WertmanTheMad | last post by:
Ive been playing with this for a few days and thought I might thow it out for seggestions. I have Several Queries that need counts returned The Queries are Mutually Exclusive meaning whatever...
1
by: Roger Green | last post by:
I have inherited a complex database that has many dozens of queries that derive data from a people table. I now need to be able to run these queries (from within a significant number of forms)...
9
by: Dom Boyce | last post by:
Hi First up, I am using MS Access 2002. I have a database which records analyst rating changes for a list of companies on a daily basis. Unfortunately, the database has been set up (by my...
3
by: NeilAnderson | last post by:
I'm a fairly new user of access & I've never had any training, so I'm wondering if I'm doing the right thing here, or if it matter at all. I'm building a database for room booking purposes and I'm...
5
by: Jerry Hull | last post by:
I'm working with a database developed by an untrained person over several years - and on a network that has recently been upgraded with a new server installed and MS office upgraded from 2K (I...
0
by: MHenry | last post by:
Hi, I know virtually nothing about creating Macros in Access. I would appreciate some help in creating a Macro or Macros that automatically run(s) 14 Queries (three Make Table Queries, and 11...
44
by: Greg Strong | last post by:
Hello All, Is it better to create a query in DAO where a report has 4 sub-reports each of whose record source is a query created at runtime and everything is in 1 MDB file? From what I've...
1
by: loosecannon_1 | last post by:
Hello everyone, I am hoping someone can help me with this problem. I will say up front that I am not a SQL Server DBA, I am a developer. I have an application that sends about 25 simultaneous...
5
by: marshmallowww | last post by:
I have an Access 2000 mde application which uses ADO and pass through queries to communicate with SQL Server 7, 2000 or 2005. Some of my customers, especially those with SQL Server 2005, have had...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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...

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.