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

 All Forums
 Site Related Forums
 Article Discussion
 Cross-TABS Query problem !!

Author  Topic 

shahidghaffar1
Starting Member

3 Posts

Posted - 2005-03-03 : 03:15:43
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

15732 Posts

Posted - 2005-03-03 : 07:35:09
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 - 2005-03-03 : 23:32:03
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

7423 Posts

Posted - 2005-03-04 : 07:22:22
What technology are you using to display/format the results to the users?

- Jeff
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2005-03-04 : 08:04:57
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 - 2005-03-06 : 23:12:20
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
   

- Advertisement -