Recent content by afs84

  1. A

    Help with simple query to produce sum

    You my friend, have just ended 24hrs + of misery. Works like a charm. Thank you so much. Sorry for being a bit ignorant. Now to just translate that to my complicated real DB :(
  2. A

    Help with simple query to produce sum

    Although still, If one table doesn't contain an entry for "January" for example, nothing is returned ** Edit: Just saw your post, you are right...So what now?
  3. A

    Help with simple query to produce sum

    This seems to work: SELECT Query1.Month, Query1.SumOfExpenseAmount, Query2.SumOfIncomeAmount FROM (ReportMonths INNER JOIN Query1 ON ReportMonths.MonthName = Query1.Month) INNER JOIN Query2 ON ReportMonths.MonthName = Query2.Month;
  4. A

    Help with simple query to produce sum

    It now gives a syntax error, tried to make sure nothing is incorrect and nothing is. Missing Operator.
  5. A

    Help with simple query to produce sum

    In my last post i was talking about my original query where i queried 2 tables at the same time and was getting wrong numbers. I meant the query should in theory return this: Month........IncomeAmount......ExpenseAmount January............null.......................200...
  6. A

    Help with simple query to produce sum

    Alright i'll explain my last post later... So here is my code, had to edit it a bit to fit my example: Query1: SELECT DailyExpense.Month, Sum(DailyExpense.ExpenseAmount) AS SumOfExpenseAmount FROM DailyExpense GROUP BY DailyExpense.Month; Query2: SELECT DailyIncome.Month...
  7. A

    Help with simple query to produce sum

    Now my main issue is this, the query seems to populate null values with previous values. So from my example above: Month........IncomeAmount......ExpenseAmount January............100........................200 January............200........................200...
  8. A

    Help with simple query to produce sum

    No I don't have a table for months. I did create one though and connected it to the previous two queries, then queried it, and magically it was able to reproduce my original problem but now with the sums produced by the two other queries. Should it be that hard?
  9. A

    Help with simple query to produce sum

    Mmmm....ok Could you please just elaborate some more with the example I gave above?
  10. A

    Help with simple query to produce sum

    The "Month" field name is just an example for simplicity. Your solution is good but here's the issue. If I do create separate queries for each table and then join both queries on the Month field, I will get correct results if and only if - back to my example "January" Exists in both tables...
  11. A

    Help with simple query to produce sum

    Tried that...still giving randomly different but similar results
  12. A

    Help with simple query to produce sum

    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...
Back
Top Bottom