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
 SQL Server 2000 Forums
 SQL Server Development (2000)
 cross tab report

Author  Topic 

sqlbee
Starting Member

11 Posts

Posted - 2003-08-13 : 12:28:16
can we use cross tab report got character fields too?

SELECT Employee,
CASE FIELD_NAME WHEN 'A-CDSP Full' THEN A_FIELD END AS Q1,
CASE FIELD_NAME WHEN 'A-DayOfEvntPlanChg' THEN A_FIELD END AS Q2,
CASE FIELD_NAME WHEN 'A-Roster Code' THEN A_FIELD END AS Q3,
CASE FIELD_NAME WHEN 'A-Self Empl SS Part' THEN A_FIELD END AS Q4
FROM #temp

I need to take the employee and A_field and match field_name with A_field
and now i get employee,field_name,field_name,Field_name.....
and the value of field name should match with the corresponding A_Field

A_FIELD N_FIELD FIELD_NAME EMPLOYEE D_FIELD

---------- ------------- -------------------- -----------
------------------------------------------------------
N .00 A-CDSP Full 1
1753-01-01 00:00:00.000
NA . 00 A-DayOfEvntPlanChg 1
1753-01-01 00:00:00.000
LAYWORKER .00 A-Roster Code 1
1753-01-01 00:00:00.000
NY .00 A-Self Empl SS Part 1
1753-01-01 00:00:00.000
N .00 P-CRP$ to LCC 1
1753-01-01 00:00:00.000

THIS IS A VIEW NOW I NEED TO GET THE RESULT AS

EMPLOYEE A-CDSP Full A-DayOfEvntPlanChg A-Roster Code A-Self Empl
SS Part P-CRP$ to LCC
1 N NA LAYWORKER NY
N
   

- Advertisement -