Someone123
New member
- Local time
- Yesterday, 23:58
- Joined
- Nov 28, 2007
- Messages
- 6
Good afternoon,
I have a simple database that contains double entry book-keeping records,
e.g.
Getting paid £50.00 (moving £50.00 from account "wages" to account "cash" would be:
ID | date | account | sum
--------------------------------------------------
0001 | 20-04-10 | wages | -50
0002 | 20-04-10 | cash | 50
The concept of double-ended book-keeping in this manner is very sound and has alot of virtues, however my problems arise when I want to view all records that went from account "wages" to account "cash".
Searching entrys for account of either would return all records with that accounts name, but not specifically those that went to a particular account.
I have another table named "journal" that has a common description for one "transaction" that corresponds to two opposite entries, like the two above.
If it were two entys in two different tables that are related to each other by a third entry in a third table, the query would be easy. But the two records that are related by a record in another table exist in the same table. How might I be able to link them, so that my query can do what I require?
Thanks in anticipation of a repsonse.
I have a simple database that contains double entry book-keeping records,
e.g.
Getting paid £50.00 (moving £50.00 from account "wages" to account "cash" would be:
ID | date | account | sum
--------------------------------------------------
0001 | 20-04-10 | wages | -50
0002 | 20-04-10 | cash | 50
The concept of double-ended book-keeping in this manner is very sound and has alot of virtues, however my problems arise when I want to view all records that went from account "wages" to account "cash".
Searching entrys for account of either would return all records with that accounts name, but not specifically those that went to a particular account.
I have another table named "journal" that has a common description for one "transaction" that corresponds to two opposite entries, like the two above.
If it were two entys in two different tables that are related to each other by a third entry in a third table, the query would be easy. But the two records that are related by a record in another table exist in the same table. How might I be able to link them, so that my query can do what I require?
Thanks in anticipation of a repsonse.