Hi there, I'm currently writing an accounting system and i got stuck with this section of trying to produce the account name in a query.
i have four tables
tblPurchase
PurchaseID -Number
tblAccounts
AccountID - Number
AccountName - Text, usually has names like asset, cost of sales, expense, telephone, electricity, etc...
tblItems
ItemID, Number
AssetNum (tblAccounts.AccountName foreign key1), Number
ExpenseNum(tblAccounts.AccountName foreign key2), Number
IncomeNum(tblAccounts.AccountName foreign key3), Number
tblPurchaseLines
PurchaseNum (foreign key for tblPurchase.PurchaseID), Number
ItemNum (foreign key for tblItems.ItemID), Number
My question is how can i generate the query with the following fields:
PurchaseID
ItemID
AccountName of AssetNum
AccountName of ExpenseNum
AccountName of IncomeNum
I am aware that the query would produce three PurchaseID's for every ItemID it would encounter for every PurchaseLine.
Please point me in the right direction.
i have four tables
tblPurchase
PurchaseID -Number
tblAccounts
AccountID - Number
AccountName - Text, usually has names like asset, cost of sales, expense, telephone, electricity, etc...
tblItems
ItemID, Number
AssetNum (tblAccounts.AccountName foreign key1), Number
ExpenseNum(tblAccounts.AccountName foreign key2), Number
IncomeNum(tblAccounts.AccountName foreign key3), Number
tblPurchaseLines
PurchaseNum (foreign key for tblPurchase.PurchaseID), Number
ItemNum (foreign key for tblItems.ItemID), Number
My question is how can i generate the query with the following fields:
PurchaseID
ItemID
AccountName of AssetNum
AccountName of ExpenseNum
AccountName of IncomeNum
I am aware that the query would produce three PurchaseID's for every ItemID it would encounter for every PurchaseLine.
Please point me in the right direction.