How can I transfer CrossTab to origial format?

amolin

Registered User.
Local time
Today, 13:14
Joined
Apr 29, 2004
Messages
35
For example:

I want to transform this table

Name Jan Feb Mar Apr ...................
David 5 6 8 5

to

Name Month Number
David Jan 5
David Feb 6
David Mar 8
David Apr 5
.
.
.
.
Can I do this by query?
 
You can do it with a UNION query.

However, to sort the months properly, you will need a second query to join the UNION query with a SortOrder table. See database attached.
.
 

Attachments

Jon K said:
You can do it with a UNION query.

However, to sort the months properly, you will need a second query to join the UNION query with a SortOrder table. See database attached.
.

Thank you !

But if the column number of crosstab is not fixed ,how can I do?

By the way,I don't need sorting in result table .



Thank you again..
 
If the column number is not fixed, you will need to use VBA to loop through the fields
to dynamically build the UNION query or
to directly put the data into a temporary table.
 
Jon K said:
If the column number is not fixed, you will need to use VBA to loop through the fields
to dynamically build the UNION query or
to directly put the data into a temporary table.


I see,Thank you!
 

Users who are viewing this thread

Back
Top Bottom