Senin, 30 Mei 2011

RE: [MS_AccessPros] Manipulating data.

 

Robin-

To "unpivot" a table, use a UNION query:

SELECT ClubName, "Posn1" As PositionName, Posn1 As Position
FROM MyTable
UNION ALL
SELECT ClubName, "Posn2" As PositionName, Posn2 As Position
UNION ALL
SELECT ClubName, "Posn3" As PositionName, Posn3 As Position
UNION ALL ...

.. and so forth until you've UNIONed all 6 positions.

John Viescas, author
Microsoft Office Access 2010 Inside Out
Microsoft Office Access 2007 Inside Out
Building Microsoft Access Applications
Microsoft Office Access 2003 Inside Out
SQL Queries for Mere Mortals
http://www.viescas.com/
(Paris, France)

-----Original Message-----
From: MS_Access_Professionals@yahoogroups.com
[mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of Robin Chapple
Sent: Tuesday, May 31, 2011 5:35 AM
To: MS_Access_Professionals@yahoogroups.com
Subject: [MS_AccessPros] Manipulating data.

I have a database that has been presented in the format:

ClubName - Posn1 - Posn2 - Posn3 - Posn4 - Posn5 - Posn6 - and so on.

I need it in the format:

ClubName - Posn1
ClubName - Posn2
ClubName - Posn3
ClubName - Posn4
ClubName - Posn5
ClubName - Posn6

How do I manipulate the original data?

Many thanks,

Robin Chapple

------------------------------------

Yahoo! Groups Links

__._,_.___
Recent Activity:
MARKETPLACE

Stay on top of your group activity without leaving the page you're on - Get the Yahoo! Toolbar now.


Find useful articles and helpful tips on living with Fibromyalgia. Visit the Fibromyalgia Zone today!

.

__,_._,___

Tidak ada komentar:

Posting Komentar