Rotating the result set is normally done using PIVOT or TRANSFORM operation. Access has a TRANSFORM statement which could be used in this case. See
TRANSFORM Statement (Microsoft Access SQL)[
^]
However, if this has to do with something reporting or similar, I would advise to do all the formatting in reporting tool, not in the SQL. This will save a lot of headache.
Having that said, if the amount of rows is static, you can also consider something like
If the original query is
SELECT Name, C1, C2, C3, C4
FROM MyTable
WHERE Name IN ('t1001','t1002','t1003','t1004')
you could 'rotate' it like this:
SELECT 'C1' AS Name,
t1.c1 as 't1001',
t2.c1 as 't1002',
t3.c1 as 't1003',
t4.c1 as 't1004'
FROM MyTable t1,
MyTable t2,
MyTable t3,
MyTable t4,
WHERE t1.Name = 't1001'
AND t2.Name = 't1002'
AND t3.Name = 't1003'
AND t4.Name = 't1004'
UNION ALL
SELECT 'C2' AS Name,
t1.c2 as 't1001',
t2.c2 as 't1002',
t3.c2 as 't1003',
t4.c2 as 't1004'
FROM MyTable t1,
MyTable t2,
MyTable t3,
MyTable t4,
WHERE t1.Name = 't1001'
AND t2.Name = 't1002'
AND t3.Name = 't1003'
AND t4.Name = 't1004'
UNION ALL
SELECT 'C3' AS Name,
t1.c3 as 't1001',
t2.c3 as 't1002',
t3.c3 as 't1003',
t4.c3 as 't1004'
FROM MyTable t1,
MyTable t2,
MyTable t3,
MyTable t4,
WHERE t1.Name = 't1001'
AND t2.Name = 't1002'
AND t3.Name = 't1003'
AND t4.Name = 't1004' and so on