Crosstab query

M

mcarter

I have a table with fields f1, f2, f3, name1, name2, name3, name4, f4, f5.

I need the table to look like f1, f2, f3, name, f4, f5 where it would list
the
name1-name4 in rows instead of columns. (ie reverse crosstab).

How do I transpose this table so that the names are in 1 field (in 4 rows)
instead of
4 separate fields in 1 row?

Thanks in advance!
 
K

KARL DEWEY

Use a union query something like this --
SELECT f1, f2, f3, name1 AS NAME, f4, f5
FROM YourTable
UNION SELECT f1, f2, f3, name2 AS NAME, f4, f5
FROM YourTable
UNION SELECT f1, f2, f3, name3 AS NAME, f4, f5
FROM YourTable
UNION SELECT f1, f2, f3, name4 AS NAME, f4, f5
FROM YourTable.
 

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