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
 General SQL Server Forums
 New to SQL Server Programming
 matrix rows in a matrix table

Author  Topic 

maggie21620
Starting Member

27 Posts

Posted - 2013-07-03 : 14:27:42
i have a qry but when i run the matrix table only returns one row.
DECLARE @NAME VARCHAR (60)
SET @NAME = 'GRAY'


SELECT DISTINCT

dv.NAME,
--id.FIRSTNAME ,
--id.LASTNAME ,
fb.MSOOPRID ,
dv.LOGIN_ID,
fb.DEPT ,
up.PHONENBR ,
fb.OPR ,
dv.PERNR ,
dv.WORK_EMAIL ,
dv.SUPERVISOR_NAME ,
dv.JOB_DESCR ,
dv.WORK_LOCATION ,
dv.EMPL_STATUS ,
dv.EMPL_STATUS_DESCR ,
-- fb.SOURCE_UPDATE_DATE ,
dv.EMPLID ,
dv.ORIGINAL_HIRE_DT ,
dv.WEEKLY_HOURS ,
dv.AD_LAST_LOGON
FROM [freedomBilling].[dbo].[IDST_56_OPERATOR_ID] fb -- JOIN [INFODDP].[dbo].[IDST_SYS_OPERATOR_INFO] id ON id.MSOOPRID = fb.MSOOPRID
JOIN [HR_STORE].[dbo].[V_DIVISIONS] dv ON fb.MSOOPRID COLLATE Latin1_General_BIN = LEFT(dv.LOGIN_ID,
9)
LEFT JOIN spitfire.comtrac.userDataPernr up ON up.CLASSIFY = CAST(dv.PERNR AS VARCHAR(100))
JOIN freedom.dbo.corpList c ON c.corpNum = fb.ACCTCORP

WHERE fb.MSOOPRID <> '3RD%'
AND c.corpName = 'FREEDOM REGION'
--AND ID.DATASET = 'SYS1A'
AND ORG_HIERARCHY_LEVEL1_DESCR LIKE 'NORTHEAST DIVISION%'
AND ORG_HIERARCHY_LEVEL2_DESCR = 'Freedom Region'

AND FB.STAT = '1' --ACTIVE MSOs
AND DV.EMPL_STATUS IN ( '1', '3' )
AND DV.SUPERVISOR_NAME LIKE ('%' + @NAME +'%')
ORDER BY DV.SUPERVISOR_NAME




any suggestions how to more than one row to display, when i run the report i get all i set up in the matrix but still only one row of data

thanks

none

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-07-03 : 14:54:51
Cant guess anything without seeing how data is in tables and how you want output to come

Refer below for guidelines on posting required info.

http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
   

- Advertisement -