Hello,
I'm currently having an issue where I have hit a brick wall so any help would be appreciated.
So lets say I have two tables, DailyIncome and DailyExpense with no relationships, for simplicity lets assume both only have two fields... DailyIncome has Month and IncomeAmount, and Daily Expense has Month and ExpenseAmount.
I'm trying to build a query to show me sums of IncomeAmount and ExpenseAmount from the two tables for a certain month. simplicity lets assume the following records:
DailyIncome Table:
Month.........IncomeAmount
January............100
January............200
DailyExpense Table:
Month.........Expense Amount
January............200
January............300
What I want the query to show me is the following Sums based on the criteria "January":
Month.......IncomeAmount......ExpenseAmount
January.............300.......................500
I did a simple select query, but for some reason i keep getting either wrong calculation (doubled)or extra records which aren't there added.
Usually this happens:
Month.......IncomeAmount......ExpenseAmount
January............600......................1000
I removed the sums and usually see the following:
Month........IncomeAmount......ExpenseAmount
January............100........................200
January............200........................200
January............100........................300
January............200........................300
It seems like its populating empty values with repeated data.
My most basic code looks like this:
SELECT DailyIncome.Month, DailyIncome.IncomeAmount, DailyExpense.ExpenseAmount,
FROM DailyIncome, DailyExpense
WHERE (((DailyIncome.Month)="January"));
I tried playing around with the code, choosing the month field from both tables, selecting unique records but nothing seems to work...Im pretty sure by now that i'm doing something really wrong or that i don't really understand queries... Please help
and bare with me because as i said, my understanding of queries is very shallow.
I'm currently having an issue where I have hit a brick wall so any help would be appreciated.
So lets say I have two tables, DailyIncome and DailyExpense with no relationships, for simplicity lets assume both only have two fields... DailyIncome has Month and IncomeAmount, and Daily Expense has Month and ExpenseAmount.
I'm trying to build a query to show me sums of IncomeAmount and ExpenseAmount from the two tables for a certain month. simplicity lets assume the following records:
DailyIncome Table:
Month.........IncomeAmount
January............100
January............200
DailyExpense Table:
Month.........Expense Amount
January............200
January............300
What I want the query to show me is the following Sums based on the criteria "January":
Month.......IncomeAmount......ExpenseAmount
January.............300.......................500
I did a simple select query, but for some reason i keep getting either wrong calculation (doubled)or extra records which aren't there added.
Usually this happens:
Month.......IncomeAmount......ExpenseAmount
January............600......................1000
I removed the sums and usually see the following:
Month........IncomeAmount......ExpenseAmount
January............100........................200
January............200........................200
January............100........................300
January............200........................300
It seems like its populating empty values with repeated data.
My most basic code looks like this:
SELECT DailyIncome.Month, DailyIncome.IncomeAmount, DailyExpense.ExpenseAmount,
FROM DailyIncome, DailyExpense
WHERE (((DailyIncome.Month)="January"));
I tried playing around with the code, choosing the month field from both tables, selecting unique records but nothing seems to work...Im pretty sure by now that i'm doing something really wrong or that i don't really understand queries... Please help

Last edited: