Please start any new threads on our new site at http://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Site Related Forums
 Article Discussion
 Cross-TABS Query problem !!
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

shahidghaffar1
Starting Member

3 Posts

Posted - 03/03/2005 :  03:15:43  Show Profile  Reply with Quote
Hi,

I am facing a problems with regards to implementing Cross TAB in one of my result sets.

I have a result set with the following data nd format:

Emp_Name Designation Trade Site Electric

John Executive Yes No Optional
Mike Manager No Optional Yes
Rite Head Optional No Yes

I want to display this result set so as to display it in the format

Name John Mike Rite
Designation Executive Manager Head
Trade Yes No Optional
Site No Optional No
Electric Optional Yes Yes

Moreover the Number of Emp_Name generated is dynamic.

Please advice as to how to go about it . I have tried a number of solutions that are available on the net but I failed.

Thanks,
Shahid

robvolk
Most Valuable Yak

USA
15732 Posts

Posted - 03/03/2005 :  07:35:09  Show Profile  Visit robvolk's Homepage  Reply with Quote
Technically this is not a cross tab, it's a transposition/rotation, and it's extremely difficult to accomplish. It would actually be easier to do this in Excel than through SQL or some kind of reporting mechanism.
Go to Top of Page

shahidghaffar1
Starting Member

3 Posts

Posted - 03/03/2005 :  23:32:03  Show Profile  Reply with Quote
But there must be a way in order to accomplish this transposition or rotation in SQL Server.

Shahid Ghaffar
Go to Top of Page

jsmith8858
Dr. Cross Join

USA
7423 Posts

Posted - 03/04/2005 :  07:22:22  Show Profile  Visit jsmith8858's Homepage  Reply with Quote
What technology are you using to display/format the results to the users?

- Jeff
Go to Top of Page

robvolk
Most Valuable Yak

USA
15732 Posts

Posted - 03/04/2005 :  08:04:57  Show Profile  Visit robvolk's Homepage  Reply with Quote
quote:
But there must be a way in order to accomplish this transposition or rotation in SQL Server
Why "must" there be a way? It's not a relational operation at all, it's purely presentation, and it's rarely needed or even useful. If it were, there WOULD be a way to do it.
Go to Top of Page

shahidghaffar1
Starting Member

3 Posts

Posted - 03/06/2005 :  23:12:20  Show Profile  Reply with Quote
Hello,

I am using Crystal Reports 10.0 to display data to the users . I agree that it is purely presentation .

Shahid Ghaffar
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000