Problem relating to data normalisation

spooky30

Registered User.
Local time
Today, 21:41
Joined
Apr 20, 2006
Messages
15
I have following tables and fields for cash book

Transactions-id,Heads,Subheads,Date,Amount,
Heads-id,heads
Subheads-id,heads,subheads

Entry doneby-id,Name

i want to put details in transactions table based on head i have chosen which can be either reciept and payment I want to make Reciept Details and Payment details Seperate tables as there is diffrent type of details required

I am unable to link Table-Reciept details/Payment details as each table is individually related to one and only one record in Heads table ,unable to understand how to make a join so as to relate reciepts head to reciept details and payment head to payment details so as when i choose reciept head in transaction table i have to fill details pertaining to reciept only
 
this is a question of taste

personally i would put all transactions in a single table, with a transaction type identiifer. generally i would store the transaction value correctly in repsect of double entry rules

ie debits as plus, credits as minus, that way you can sum transaction totals without needing ot massage them further
 
I also do it the way Gemma suggested, but there is another way if you want to (or really MUST, because of your business model) keep things separated.

Look up UNION queries as a way to combine debits from one table and credits from another table. Then when you want totals or summaries, you build them from the UNION query as your base.
 

Users who are viewing this thread

Back
Top Bottom