On 2008-04-07 15:18:49 -0700, "Cedric" <do_not_answer@[EMAIL PROTECTED]
> said:
> Tenants hire flats
> A building has different flats
> There are some buidings
>
> I create 5 tables:
>
> Table_1 : Tenant_ID, Tenant_Name
> Table_2 : Building_ID, Buiding_Name
> Table_3 : Flat_ID, Flat_number
>
> T_Tenant_Buiding : TE_1_ID, BU_ID
> T_Tenant_Flat : TE_2_ID, FL_ID
>
>
> and 4 Relation****ps :
>
> Tenant_ID = TE_1_ID
> Buiding_ID = BU_ID
>
> Tenant_ID = TE_2_ID
> Flat_ID = FL_ID
>
>
> I use ****tal for defining tenant / buiding
> and the same, ****tal for defining tenant / flat
>
> the problem that there is no relation between
> buiding and flat. And I do not know how to define it!
Each flat record should have a Building_ID. You seem to be laboring
under a limitation of 2 key fields per table, and that's not correct.
Each table can have as many IDs as necessary.
Revise your relation****ps so:
Parent table = Buildings (Building ID)
Child Table = Flats (FlatID and Building ID)
Table = Tenants( Tenant ID)
Join Table (Tenancy) = Tenant x Flat (Tenant ID and Flat ID) put in
start & end dates. A tenant can then have more than one tenancy, say if
they move from one flat to another.
Relate Building to Flat (Building ID in both tables)
Relate Flat and Tenant to the Tenancy file
Tenant then becomes related to Building through the Tenancy file and
Flat table.
Do your re****ts from the Tenancy table. Bring in the Flat Address and
the Building Name and the Tenant name through the above relation****ps.
In the Tenancy table you need to include a Start Date & End date of the
tenancy. Do a find on currently open tenancies and you'll be able to
produce the re****t that you want.
--
Lynn Allen
--
www.semiotics.com
Member Filemaker Business Alliance
Long Beach, CA


|