Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Displaying column data

Posted on 2009-04-11
2
Medium Priority
?
239 Views
Last Modified: 2012-05-06
I have a stored proc that brings back data like this:
Id, Name, Code, Quantity
1    x          c1        2
2    y         c2         5
3    z          c1        10

I want to have it like this: basically, i want to have "Code" as the column header with "quantity" under it. I dont want to have a olumn for code and a column for corresponding quantity. Doable??

id, Name, c1,  c2,
1   x         2      0
2   y         0      5
3  z          10    0
0
Comment
Question by:Camillia
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 5

Accepted Solution

by:
QuintainT earned 2000 total points
ID: 24124665
This can probably be done using a PIVOT query. See http://www.mssqltips.com/tip.asp?tip=1019 
This requires you to have a fixed, known number of codes to work though. Is this possible?
0
 
LVL 7

Author Comment

by:Camillia
ID: 24125320
let me look, will post back.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article will provide a solution for an error that might occur installing a new SQL 2005 64-bit cluster. This article will assume that you are fully prepared to complete the installation and describes the error as it occurred durin…
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question