Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / August 2007

Tip: Looking for answers? Try searching our database.

Data mining

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
KimTong - 24 Aug 2007 16:52 GMT
Hi,

I'd like to change data column to row, it's the apposite way with cross tab
query. These are the sample of data:

Product       NY                  NJ             CT      
AAA            3                     5               4    
BBB           5                     10              6
CCC           6                      4              

And I'd like to change data above become like these:

Product   State    Qty
AAA       NY        3
AAA       NJ         5
AAA       CT         4
BBB       NY        5
BBB       NJ       10
BBB       CT        6
CCC       NY       6
CCC       NJ        4

Thanks in advance
Duane Hookom - 24 Aug 2007 17:14 GMT
You could use a union query

SELECT Product, "NY" as State, [NY] As Qty
FROM tblNoNameGiven
WHERE [NY] is not Null
UNION ALL
SELECT Product, "NJ", [NJ]
FROM tblNoNameGiven
WHERE [NJ] is not Null
UNION ALL
SELECT Product, "CT", [CT]
FROM tblNoNameGiven
WHERE [CT] is not Null;

Signature

Duane Hookom
Microsoft Access MVP

> Hi,
>
[quoted text clipped - 19 lines]
>
> Thanks in advance
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.