A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

chnge query for a join file



 
 
Thread Tools Display Modes
  #1  
Old June 13th, 2008, 07:31 PM posted to microsoft.public.access.tablesdbdesign
JRough
external usenet poster
 
Posts: 44
Default chnge query for a join file

I need to change this query because I needed to add a join file
between company and car_owners.
There is a many to many between cars and owners. This is for rental
purposes. One car could have more than one owner_company and one owner
could have more than one cars. So to get this same query with the
join file, what do I do?
Select car_o.car_id AS car_id, co.comp_name AS comp_name,
car_o.start_date AS start_date,car_o.end_date AS end_date
from (MyDatabase.CAR_OWNER car_o
INNER JOIN MyDAtabase.COMPANY co)
where (car_o.comp_id=co.comp_id);

thanks,
  #2  
Old June 13th, 2008, 07:50 PM posted to microsoft.public.access.tablesdbdesign
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default chnge query for a join file

Try this --
SELECT car_o.car_id AS car_id, co.comp_name AS comp_name, car_o.start_date
AS start_date, car_o.end_date AS end_date
FROM CAR_OWNER AS car_o LEFT JOIN COMPANY AS co ON car_o.comp_id = co.comp_id;

--
KARL DEWEY
Build a little - Test a little


"JRough" wrote:

I need to change this query because I needed to add a join file
between company and car_owners.
There is a many to many between cars and owners. This is for rental
purposes. One car could have more than one owner_company and one owner
could have more than one cars. So to get this same query with the
join file, what do I do?
Select car_o.car_id AS car_id, co.comp_name AS comp_name,
car_o.start_date AS start_date,car_o.end_date AS end_date
from (MyDatabase.CAR_OWNER car_o
INNER JOIN MyDAtabase.COMPANY co)
where (car_o.comp_id=co.comp_id);

thanks,

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 03:27 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.