G
Guest
Dear All,
I have 3 tables below:
I have tried to use this union query, with the query statement (at SQL view
) as follows:
SELECT ID,Client,Date, ResultA, ErrorA FROM A
UNION
SELECT ID,Client,Date, ResultB, ErrorB FROM B
UNION
SELECT ID,Client,Date, ResultC, ErrorC FROM C
The result as datasheet view as follows:
Union Query Results
ID Client Date ResultA ErrorA
1 P 1/1/06 333 0.83 ==> for task C
1 P 1/1/06 500 5.00 ==> for task A
1 P 1/1/06 677 3.39 ==> for task B
1 Q 4/1/06 358 3.58
1 Q 4/1/06 667 3.34
2 R 5/1/06 789 7.89
2 R 5/1/06 999 5.00
3 Q 3/1/06 233 1.17
5 R 2/1/06 222 0.56
6 Q 3/1/06 111 0.28
If I want to have different column for Task A, Task B & Task C(as they are
all independent things and can not be combined/add together),some thing
like the following "multicolumn(8 column)" format:
ID Client Date ResultA ErrorA ResultB ErrorB ResultC ErrorC
1 P 1/1/06 500 5 677 3.39 333
0.83
0.83
1 Q 4/1/06 358 3.6 667 3.39 Null
Null
....an so on..
Instead of just have 2 columns ResultA ErrorA.
Would anyone please help to advise any solution?
Many thanks for your help,
PA
I have 3 tables below:
I have tried to use this union query, with the query statement (at SQL view
) as follows:
SELECT ID,Client,Date, ResultA, ErrorA FROM A
UNION
SELECT ID,Client,Date, ResultB, ErrorB FROM B
UNION
SELECT ID,Client,Date, ResultC, ErrorC FROM C
The result as datasheet view as follows:
Union Query Results
ID Client Date ResultA ErrorA
1 P 1/1/06 333 0.83 ==> for task C
1 P 1/1/06 500 5.00 ==> for task A
1 P 1/1/06 677 3.39 ==> for task B
1 Q 4/1/06 358 3.58
1 Q 4/1/06 667 3.34
2 R 5/1/06 789 7.89
2 R 5/1/06 999 5.00
3 Q 3/1/06 233 1.17
5 R 2/1/06 222 0.56
6 Q 3/1/06 111 0.28
If I want to have different column for Task A, Task B & Task C(as they are
all independent things and can not be combined/add together),some thing
like the following "multicolumn(8 column)" format:
ID Client Date ResultA ErrorA ResultB ErrorB ResultC ErrorC
1 P 1/1/06 500 5 677 3.39 333
0.83
0.83
1 Q 4/1/06 358 3.6 667 3.39 Null
Null
....an so on..
Instead of just have 2 columns ResultA ErrorA.
Would anyone please help to advise any solution?
Many thanks for your help,
PA