S
SvenS.
Hi NG,
As a newbie, I've constructed 2 queries where Payments on
Accounts (ID_A) and subaccounts (ID_B) are added. This
works fine. One query is for the planned budget and one
for the running payments.
Now I want the accounts and subaccounts to have the
payments (1st query) and budget (2nd query) next to each
other in one query. When I put both into one query I
either get the combinations of the ID_As and Bs several
times or, if I join the tables, get sums that are
multiplied many times compared to what they should
actually be - like 36.00 instead of 2.00 ...
I hope that was understandable - Here's an example:
Q1
ID_A ID_B Amount
1 1 1.00
1 2 4.00
2 1 2.00
Q2
ID_A ID_B Amount
1 1 1.00
2 1 1.00
3 1 2.00
The result that I want is -
Q1
ID_A ID_B Q1 Q2
1 1 1.00 1.00
1 2 4.00 0.00
2 1 2.00 1.00
3 1 0.00 2.00
The result I get is something like this-
ID_A ID_B Q1 Q2
1 1 1.00 1.00
1 1 1.00 1.00
2 1 2.00 1.00
3 1 1.00 2.00
2 1 2.00 1.00
2 1 2.00 1.00
3 1 1.00 2.00
I'm sure this can't be too hard, however I'm having great
difficulties getting it to work - Thanks in advance,
Sven S.
As a newbie, I've constructed 2 queries where Payments on
Accounts (ID_A) and subaccounts (ID_B) are added. This
works fine. One query is for the planned budget and one
for the running payments.
Now I want the accounts and subaccounts to have the
payments (1st query) and budget (2nd query) next to each
other in one query. When I put both into one query I
either get the combinations of the ID_As and Bs several
times or, if I join the tables, get sums that are
multiplied many times compared to what they should
actually be - like 36.00 instead of 2.00 ...
I hope that was understandable - Here's an example:
Q1
ID_A ID_B Amount
1 1 1.00
1 2 4.00
2 1 2.00
Q2
ID_A ID_B Amount
1 1 1.00
2 1 1.00
3 1 2.00
The result that I want is -
Q1
ID_A ID_B Q1 Q2
1 1 1.00 1.00
1 2 4.00 0.00
2 1 2.00 1.00
3 1 0.00 2.00
The result I get is something like this-
ID_A ID_B Q1 Q2
1 1 1.00 1.00
1 1 1.00 1.00
2 1 2.00 1.00
3 1 1.00 2.00
2 1 2.00 1.00
2 1 2.00 1.00
3 1 1.00 2.00
I'm sure this can't be too hard, however I'm having great
difficulties getting it to work - Thanks in advance,
Sven S.