Transpose

R

Ranjit kurian

I hv three columns as shown below.

Name Month Amount
C72651 Dec-08 10
D398456-00 Dec-08 20
Y65148413 Dec-08 30
U1284563 Nov-08 40
T21645984 Oct-08 50
E8123321 Sep-07 60

I need a single query to convert the above rows into separate columns based
on month column as shown below

Name Dec-08 Nov-08 Oct-08 Sep-07
C72651 10 0 0 0
D398456-00 20 0 0 0
Y65148413 30 0 0 0
U1284563 0 40 0 0
T21645984 0 0 50 0
E8123321 0 0 0 60
 
J

John W. Vinson

I hv three columns as shown below.

Name Month Amount
C72651 Dec-08 10
D398456-00 Dec-08 20
Y65148413 Dec-08 30
U1284563 Nov-08 40
T21645984 Oct-08 50
E8123321 Sep-07 60

I need a single query to convert the above rows into separate columns based
on month column as shown below

Name Dec-08 Nov-08 Oct-08 Sep-07
C72651 10 0 0 0
D398456-00 20 0 0 0
Y65148413 30 0 0 0
U1284563 0 40 0 0
T21645984 0 0 50 0
E8123321 0 0 0 60

A Crosstab query is the appropriate tool for this purpose. Use the Crosstab
wizard on the new-query window. Post back if you have problems...
 

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