A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

'Un-Crosstab'



 
 
Thread Tools Display Modes
  #1  
Old September 24th, 2004, 09:51 AM
colin ashley
external usenet poster
 
Posts: n/a
Default 'Un-Crosstab'

I have a table that shows the jobs that people carry out. The column
headings are person ID's, and the row headings are job ID's. An 'x' at an
intersection shows that a person can perform a job. All other intersections
are blank.
I would like to transform this data into a linear relationship
table . To 'un-crosstab' it, if you like!

This is how the existing table looks:

Person ID's
Job ID's 1001 1002 1003
1001 x x
1002 x
1003 x

I need to derive a table that looks like this:
Job ID Person ID
1001 1001
1001 1003
1002 1002
1003 1001

Any ideas or help would be much appreciated!

colin


  #2  
Old September 24th, 2004, 11:26 AM
Michel Walsh
external usenet poster
 
Posts: n/a
Default

Hi,


SELECT JobID, 1001 AS PersonID FROM myTable WHERE NOT [1001] Is Null
UNION ALL
SELECT JobID, 1002 FROM myTable WHERE NOT [1002] Is Null
UNION ALL
SELECT JobID, 1003 FROM myTable WHERE NOT [1003] Is Null




Hoping it may help,
Vanderghast, Access MVP


"colin ashley" wrote in message
...
I have a table that shows the jobs that people carry out. The column
headings are person ID's, and the row headings are job ID's. An 'x' at an
intersection shows that a person can perform a job. All other
intersections
are blank.
I would like to transform this data into a linear relationship
table . To 'un-crosstab' it, if you like!

This is how the existing table looks:

Person ID's
Job ID's 1001 1002 1003
1001 x x
1002 x
1003 x

I need to derive a table that looks like this:
Job ID Person ID
1001 1001
1001 1003
1002 1002
1003 1001

Any ideas or help would be much appreciated!

colin




  #3  
Old September 26th, 2004, 07:40 AM
colin ashley
external usenet poster
 
Posts: n/a
Default

Thank you very much Michel.Your solution worked perfectly.

The actual table contains about 40 columns, so I've got a spot of query
writing to do!

thanks again!

Colin


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Crosstab Query Thomas Kroljic Running & Setting Up Queries 2 August 25th, 2004 03:10 PM
pivot table sort on crosstab Johnny C. Running & Setting Up Queries 1 August 11th, 2004 01:45 PM
Crosstab - Make table DEI Running & Setting Up Queries 1 June 21st, 2004 06:27 PM
Crosstab w/ aggregate criteria Leann Running & Setting Up Queries 4 June 18th, 2004 07:19 PM


All times are GMT +1. The time now is 04:57 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.