nested AND loop query

A

aaaagc

I have this Table :

ID Course Det1 Det2 Det3
St_1 Curse1 1 2 3
St_1 Curse2 1 2 3
St_1 Curse3 1 2 3
St_2 Curse1 1 2 3
St_2 Curse2 1 2 3
St_2 Curse3 1 2 3
St_3 Curse1 1 2 3
St_3 Curse2 1 2 3
St_3 Curse3 1 2 3
St_4 Curse1 1 2 3
St_4 Curse2 1 2 3
St_4 Curse3 1 2 3
St_5 Curse1 1 2 3
St_5 Curse2 1 2 3
St_5 Curse3 1 2 3


AND I Need This Report By using query only :

Curse1 Curse2
Curse3
Det1 Det2 Det3 Det1 Det2 Det3 Det1
Det2 Det3
St_1 1 2 3 1 2 3 1
2 3
St_2 1 2 3 1 2 3 1
2 3
St_3 1 2 3 1 2 3 1
2 3
St_4 1 2 3 1 2 3 1
2 3
St_5 1 2 3 1 2 3 1
2 3


OR this Report :
Curse1 Curse2 Curse3
St_1 1 2 3 1 2 3 1 2 3
St_2 1 2 3 1 2 3 1 2 3
St_3 1 2 3 1 2 3 1 2 3
St_4 1 2 3 1 2 3 1 2 3
St_5 1 2 3 1 2 3 1 2 3
 
K

KARL DEWEY

Try this --
TRANSFORM First([Det1] & " " & [Det2] & " " & [Det3]) AS Expr1
SELECT aaaagc.ID
FROM aaaagc
GROUP BY aaaagc.ID
PIVOT aaaagc.Course;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top