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 » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Help with a query



 
 
Thread Tools Display Modes
  #1  
Old July 16th, 2008, 09:10 PM posted to microsoft.public.access.queries
[email protected]
external usenet poster
 
Posts: 8
Default Help with a query

I have the following tables: [I will only show the pertinent data]


Project [RecNo, ProjectName]
ProjectFile [ProjectRec, FileRec]
Files [RecNo, FileName]
Components [RecNo, StandardRec, FileRec, RefDes, Title]
StandardTypes [RecNo, ComponentType]

Schema:

Project -- ProjectFile [RecNo, ProjectRec]
Files -- Components [RecNo, FileRec]
Files -- ProjectFile [RecNo, FileRec]
StandardType -- Component [RecNo, StandardRec]

I want to write a query that is as the following:

SELECT a.ComponentType, b.RefDes, b.Title, T,
from (((StandardType as a INNER JOIN Components b ON a.RecNo = b.StandardRec)
INNER JOIN Files c ON c.FileRec = a.RecNo)
INNER JOIN ProjectFile d ON c.RecNo = d.FileRec)
INNER JOIN Projects e ON d.ProjectRec = e.RecNo;

T = Since Files is joined to ProjectFile which is joined to Projects, we
have a many to many relationship. One project has many files and one file can
belong to many projects. Hope you are with me so far. Now since Files is also
joined to Components, it is possible to know which projects that each
component is on.

So I want T to be the all the ProjectRec from ProjectFile seperated by a
",". I don't want to duplicate the components to list them all, I want to
list them once, and have a column list its association [1, 2, 5, 7, 7,
etc...]

Does that make sense? It is like I need a for loop on T


 




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 08:40 AM.


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