User Profile

Collapse

Profile Sidebar

Collapse
svjensen
svjensen
Last Activity: May 11 '11, 08:51 AM
Joined: Jan 18 '11
Location: Copenhagen, Denmark
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Yes! Got it!

    Code:
    TRANSFORM Sum(tblExpenses.Value) AS SumOfValue
    SELECT Q.ExpenseArea, Q.ExpenseType
    FROM (SELECT tblExpenseAreas.ExpenseArea, tblExpenseTypes.ExpenseType, tblExpenseAreas.uid AS AreaId, tblExpenseTypes.uid AS TypeId
    FROM tblExpenseAreas, tblExpenseTypes) As Q LEFT JOIN tblExpenses ON (Q.AreaId=tblExpenses.AreaId) AND (Q.TypeId=tblExpenses.TypeId)
    GROUP BY Q.ExpenseArea, Q.ExpenseType
    PIVOT
    ...
    See more | Go to post

    Leave a comment:


  • Ok, I got the following to work:

    Created a cross join query named qryCrossJoin:
    Code:
    SELECT tblExpenseAreas.ExpenseArea, tblExpenseTypes.ExpenseType, tblExpenseAreas.uid AS AreaId, tblExpenseTypes.uid AS TypeId
    FROM tblExpenseAreas, tblExpenseTypes;
    And used that in my cross tab query:
    Code:
    TRANSFORM Sum(tblExpenses.Value) AS SumOfValue
    SELECT qryCrossJoin.ExpenseArea, qryCrossJoin.ExpenseType
    ...
    See more | Go to post

    Leave a comment:


  • Ok, I believe that I get the cross join part now:
    SELECT * FROM tblExpenseAreas , tblExpenseTypes

    But can I use that directly in the other query? Or do I need to save it as a separate qeury, and then use that like a table?
    See more | Go to post

    Leave a comment:


  • I was actually trying to get that to work.
    I created the two additional tables (ExpensesArea and ExpensesType), and added to id fields to the Expenses table.

    I can get it to handle one of them by using outer join, but it will not accept two. It suggests that I first do one query with one join, and then use that query for the next join.
    Is that what you mean by cross join?

    And could you perhaps give an ...
    See more | Go to post

    Leave a comment:


  • Parodux,

    (will write in English in order for others to be able to read along)
    I tried your suggestion, but it still does not give me a row for 'Karuseller', 'Investering'.
    Could I be missing something?

    /Søren
    See more | Go to post

    Leave a comment:


  • svjensen
    started a topic How to force Cross tab to show row when no value?

    How to force Cross tab to show row when no value?

    Let us say, that I have a table structured like this:

    tblExpenses
    ===========
    uid autonumber (key)
    ExpenseArea text
    ExpenseType text
    Year Number
    Value Number


    With the following posts:

    uid ExpenseArea ExpenseType Year Value
    === =========== =========== ==== =====
    001 Gynger Investering 2010 15
    002 Gynger Investering 2011 10
    003...
    See more | Go to post
No activity results to display
Show More
Working...