dbTalk Databases Forums  

Question with related records

comp.databases.filemaker comp.databases.filemaker


Discuss Question with related records in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
audleman@quasika.net
 
Posts: n/a

Default Question with related records - 06-17-2005 , 05:17 PM






I have one table called Articles that is linked to a Authors table. One
article can have many authors.

Let's say I have an article with three authors. Is there a way to show
all three names on a single line? It would look like this (in a list
view)

Article 1
Author1, Author2, Author3
Article 2
Author1, Author2
..
..
..

Thanks,
Kevin


Reply With Quote
  #2  
Old   
Remi-Noel Menegaux
 
Posts: n/a

Default Re: Question with related records - 06-18-2005 , 01:51 AM






The set up is different if you tell which authors wrote this article in
the Articles record, or the reverse, what articles were written by this
author.
In the first case you may have in the Articles file, say 3 fields where
you write the max 3 Author IDs who wrote that article.
A much more flexible set up, though, is to create a third file,
"Details", which has a record per couple Article_ID and Author_ID, ie
you create a record in it for any new author you find for a given
article. (It is the n to n relationship method, like one does in
invoicing).
Then the rest is only a question of relationships, portals and layout
presentation.
Always go to the Details file - even transparently - to edit the
results, which gives you a variable number of lines.
For showing the results horizontally in the Details file, you'll have
several options, each giving a maximum number of authors :
- have a repeating field with say 20 repetitions, and copy in it by
script the Authors_IDs
- do the same with 20 new fields
- use 'merge' fileds (<<author1>>, <<author2>>, ...)
- (this one has no limitations in the number of authors per article) :
have an 'All_author' field you'll fill up by script with the 'found' or
'related' authors separated by a comma.
You may imagine that the last has my preference.
Remi-Noel

<audleman (AT) quasika (DOT) net> a écrit dans le message de news:
1119046644.260835.286640 (AT) g43g20...oglegroups.com...
Quote:
I have one table called Articles that is linked to a Authors table. One
article can have many authors.

Let's say I have an article with three authors. Is there a way to show
all three names on a single line? It would look like this (in a list
view)

Article 1
Author1, Author2, Author3
Article 2
Author1, Author2
.
.
.

Thanks,
Kevin




Reply With Quote
  #3  
Old   
audleman@quasika.net
 
Posts: n/a

Default Re: Question with related records - 06-20-2005 , 11:39 AM



Whoops, I forgot to say that I'm using a join table called
ArticleAuthor to resolve the many to many relationship. Of your
solutions above, it seems like the only one that will work is to write
a script. I was hoping there was a way to do this without a script (i
would ideally like to avoid having to run maintenance scripts wherever
possible)..

I've found a perfectly good, if unattractive, solution. I have four
portals to ArticleAuthor lined up, each starting on a different row. I
get what I want, just without any nice formatting. I'll stick with that
unless anyone has a better solution.

Thanks,
Kevin


Reply With Quote
Reply




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 On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.