Forums
 This topic is locked 
             FILE RELATIONSHIPS
 Posted 12 Jun 2001  18:48:49 
  1 
     has   voted 
  12 Jun 2001  18:48:49 Jacques Roux posted: 
 I have two files CLIENTS and PAYMENTS. In my CLIENTS file I obviously have client names and in my PAYMENTS file I have date paid etc.How do I declare a relationship between the two files. I am using Clarion database files and ODBC to link them? In Clarion I have declared the relationship, but as soon as I go via ODBC the relationship becomes void.
Replies
 Replied 12 Jun 2001  20:03:16 
   12 Jun 2001  20:03:16 Jay Blanchard replied: 
  You need to find a way to join them, most easily by creating a common column
tb_clients table has
<b>client_id</b>
client_name
client_etc
tb_payments table has
payment_id
payment_type
payment_amount
<b>client_id</b>
In SQL you would say something to the effect of
SELECT *
FROM tb_clients, tb_payments
<b>WHERE tb_clients.client_id=tb_payments.client_id</b>
  
  tb_clients table has
<b>client_id</b>
client_name
client_etc
tb_payments table has
payment_id
payment_type
payment_amount
<b>client_id</b>
In SQL you would say something to the effect of
SELECT *
FROM tb_clients, tb_payments
<b>WHERE tb_clients.client_id=tb_payments.client_id</b>