Results 1 to 3 of 3
Thread: table setup advice needed
Dec 7, 2004, 13:14 #1
table setup advice needed
I'm trying to setup a billing table that will track entities that are paid, total paid, and date paid. My database contains about 10 different tables that contain different entity types. For example employers, attorneys, doctors, farmers, etc. In order to program my billing form in the html page I was going to have the entity's record id number(autonumber) saved in an integer field of the billing table. But because I have different entity types all saved in different tables, how would I distinguish the different entity types when inputting the information and when creating reports. For example, there maybe a employer, a doctor and a attorney all with a record id of 2. When I create a report how would I set this up so the appropriate one would be pulled?
Dec 7, 2004, 13:22 #2
When I create a report how would I set this up so the appropriate one would be pulled?
- Join Date
- Jul 2004
- 0 Post(s)
- 0 Thread(s)
Use Primary and foreign keys, then Use JOINS to join the tables together.
finally, use the select statement with a where id = Primary key to retrieve the required records.
Dec 8, 2004, 13:25 #3
I'm not sure you understand the problem. I'll try and explain it again a little better.
I have a table calls tblbills, here are the fields
col2=payto (integer field)
col3=$ amount (currency field)
Currently my database has about 10 other tables all with the exact same structure:
col2=docotr name(text field)
col2=attorney name(text field)
So when I enter a new bill in tblbills, I'd like to put the col1 value of the entity I'm paying the bill to(such as tbldoctor.col1 or tblattorney.col1). But, how can I keep track of who's getting paid. The integer value won't be enough since it could be from tbldoctors, or tblattorney. How do other systems normally handle this?