cheuschober
Muse of Fire
- Local time
- Yesterday, 19:53
- Joined
- Oct 25, 2004
- Messages
- 168
Hi -- So, I'm a bit new here to the Access world. I was previously using an inflexible excel spreadsheet to do act as a record for my various finances but have made the switch to access for a much more powerful interface. Unfortunately, though, with nothing more than a poor book and the Microsoft Help Interface I'm left with many holes in my understanding of this system.
My current problem resides in a query I have created from my expense logs table.
My [Expense Logs] table has all of my expenses logged with respective date, amount, expense code (be that grocery, gasoline, internet access, etc), payment code (cash, credit, cheque, etc) and extraneous payee and note information.
Each respective payment code has it's own query (NameTrans) defined for reports I've designed like a virtual chequebook, virtual credit statements, etc. These queries get somewhat complicated when you account the fact that I might use a cheque to pay off a credit card which is information entered with a payment code for CHEQUE but an expense code of CREDIT (one record's amount being subtracted from one query and added to another's)
For my grand totals category I need to separate each payment code's totals into a separate field.
As it stands, I've gotten myself via subqueries to obtain the correct totals but for some reason I am recieving 71 records of the same totals; one for each existing record in the table! Each field has it's correct total but I shouldn't be recieving 71, or so I thought!
My goal is for a query with just one record--each record containing my one total for each respective field's account. Current sql is found below:
SELECT (SELECT Sum([BankTrans].Deposit) FROM [BankTrans])-(SELECT Sum([BankTrans].Withdrawl) FROM [BankTrans]) AS Banking,
(SELECT Sum([CreditCardTrans].Amount) FROM [CreditCardTrans]) AS CreditCard,
(SELECT Sum([CashTrans].Amount) FROM [CashTrans]) AS Cash
FROM [Expense Logs]
If anyone has any ideas on how to clean this up I'd really appreciate it. I guess the whole subquery thing is one of those holes in my undestanding of this powerful program.
Thank you so much!
~Chad
My current problem resides in a query I have created from my expense logs table.
My [Expense Logs] table has all of my expenses logged with respective date, amount, expense code (be that grocery, gasoline, internet access, etc), payment code (cash, credit, cheque, etc) and extraneous payee and note information.
Each respective payment code has it's own query (NameTrans) defined for reports I've designed like a virtual chequebook, virtual credit statements, etc. These queries get somewhat complicated when you account the fact that I might use a cheque to pay off a credit card which is information entered with a payment code for CHEQUE but an expense code of CREDIT (one record's amount being subtracted from one query and added to another's)
For my grand totals category I need to separate each payment code's totals into a separate field.
As it stands, I've gotten myself via subqueries to obtain the correct totals but for some reason I am recieving 71 records of the same totals; one for each existing record in the table! Each field has it's correct total but I shouldn't be recieving 71, or so I thought!
My goal is for a query with just one record--each record containing my one total for each respective field's account. Current sql is found below:
SELECT (SELECT Sum([BankTrans].Deposit) FROM [BankTrans])-(SELECT Sum([BankTrans].Withdrawl) FROM [BankTrans]) AS Banking,
(SELECT Sum([CreditCardTrans].Amount) FROM [CreditCardTrans]) AS CreditCard,
(SELECT Sum([CashTrans].Amount) FROM [CashTrans]) AS Cash
FROM [Expense Logs]
If anyone has any ideas on how to clean this up I'd really appreciate it. I guess the whole subquery thing is one of those holes in my undestanding of this powerful program.
Thank you so much!
~Chad