dbTalk Databases Forums  

Getting data from 2 tables...

comp.databases.filemaker comp.databases.filemaker


Discuss Getting data from 2 tables... in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Nick Trimmis
 
Posts: n/a

Default Getting data from 2 tables... - 01-01-2007 , 04:58 AM






Happy New Year to all!!!

I can't figure out this:

I have 2 tables i.e. Plates and Cups, with same fields (Name, quality
e.t.c.).

I want to join these tables data to a third table, for printing a union
list. Something like Access SQL Query (SELECT and UNION SELECT).

TIA for any tips.

FMP 8.5 MacOs 10.4.8

Nick Trimmis


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

Default Re: Getting data from 2 tables... - 01-01-2007 , 05:19 AM






My own take is that you should have only one table in which you'd add a new
field 'Type' in the 'Plate' table - fill all the existing records with
'Plate' - with a value list helping to choose between 'Plates 'and 'Cups'.
Then just import the 'Cup' records into the modified 'Plate' table - add,
with the 'replace' script line, 'Cup' to the new field in all found set of
records - and throw out the 'Cup' table. Why make complicated things when it
can be simple ?
Just my 2 cents.
Remi-Noel


"Nick Trimmis" <ntrimmis (AT) gmail (DOT) com> a écrit dans le message de news:
C1BEB5E7.10F64%ntrimmis (AT) gmail (DOT) com...
Quote:
Happy New Year to all!!!

I can't figure out this:

I have 2 tables i.e. Plates and Cups, with same fields (Name, quality
e.t.c.).

I want to join these tables data to a third table, for printing a union
list. Something like Access SQL Query (SELECT and UNION SELECT).

TIA for any tips.

FMP 8.5 MacOs 10.4.8

Nick Trimmis




Reply With Quote
  #3  
Old   
Bill
 
Posts: n/a

Default Re: Getting data from 2 tables... - 01-01-2007 , 05:56 PM



In article <C1BEB5E7.10F64%ntrimmis (AT) gmail (DOT) com>,
Nick Trimmis <ntrimmis (AT) gmail (DOT) com> wrote:

Quote:
Happy New Year to all!!!

I can't figure out this:

I have 2 tables i.e. Plates and Cups, with same fields (Name, quality
e.t.c.).

I want to join these tables data to a third table, for printing a union
list. Something like Access SQL Query (SELECT and UNION SELECT).

TIA for any tips.

FMP 8.5 MacOs 10.4.8

Nick Trimmis
Well, it depends what you want

If you want a many-to-many relationship of plates to cups, you make a
Join table. Call it Plate_Cup. Each record of the Join table assigns one
plate to one cup.

Plate needs a plate ID, call it kpPlateID, which must be unique. The
usual practice is define kpPlateID as being automatically filled by
serial number, which the user can not alter.

Same for Cup::kpCupID, a serial number.

The join table has fields for kfPlateID and kfCupID.

Relationships:

Plate::kpPlateID = Plate_Cup::kfPlateID
Cup::kpCupID = Plate_Cup::kfCupID

And off you go.

--
For email, change <fake> to <earthlink>
Bill Collins


Reply With Quote
  #4  
Old   
Helpful Harry
 
Posts: n/a

Default Re: Getting data from 2 tables... - 01-01-2007 , 05:59 PM



In article <4598ee28$0$298$426a34cc (AT) news (DOT) free.fr>, "Remi-Noel Menegaux"
<rnmenegaux_AT_free.fr> wrote:

Quote:
My own take is that you should have only one table in which you'd add a new
field 'Type' in the 'Plate' table - fill all the existing records with
'Plate' - with a value list helping to choose between 'Plates 'and 'Cups'.
Then just import the 'Cup' records into the modified 'Plate' table - add,
with the 'replace' script line, 'Cup' to the new field in all found set of
records - and throw out the 'Cup' table. Why make complicated things when it
can be simple ?
Just my 2 cents.
Don't forget Saucers, Bowls, Mugs, Platters, ... ;o)

Helpful Harry
Hopefully helping harassed humans happily handle handiwork hardships ;o)


Reply With Quote
  #5  
Old   
Howard Schlossberg
 
Posts: n/a

Default Re: Getting data from 2 tables... - 01-01-2007 , 06:40 PM



Bill's got the correct way to set it up. But I'll often have a separate
'reports' table that I might keep empty and then fill with data on the
fly -- just get your found set in each of the first two tables and then
import from each of those tables into your reports table to produce your
"union" list.

Bill wrote:
Quote:
In article <C1BEB5E7.10F64%ntrimmis (AT) gmail (DOT) com>,
Nick Trimmis <ntrimmis (AT) gmail (DOT) com> wrote:

I can't figure out this:

I have 2 tables i.e. Plates and Cups, with same fields (Name, quality
e.t.c.).

I want to join these tables data to a third table, for printing a union
list. Something like Access SQL Query (SELECT and UNION SELECT).
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Howard Schlossberg
FM Professional Solutions, Inc. Los Angeles

FileMaker 8 Certified Developer
Associate Member, FileMaker Solutions Alliance


Reply With Quote
  #6  
Old   
Nick Trimmis
 
Posts: n/a

Default Re: Getting data from 2 tables... - 01-02-2007 , 08:39 AM



Thank you all for the tips!

Remi-Noel, the solution is more complicated and I can't follow your way.

I like Bill's idea more, and I will sleep on Howard's one.

Again, thanks a lot!

Nick Trimmis


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.