jadams0173
Technical User
- Feb 18, 2005
- 1,210
I'm trying to add a yeild column to my crosstab query however i'm struggling. This is my first crosstab query btw. Here is the SQL that makes up the crosstab.
Here is the crosstab itself.
What I need to do is [Total]/[Pass] but the Column heading [PASS],is what the PIVOT is on. The crosstab returns that it doesn't recognize pass as a valid field or expression.
When ran the query looks like. I just put a value in the Yield so it would run.....
RCACCOUNT DISPLAY_NAME TOTAL YIELD FAIL PASS
12345 SOME NAME 10 20 5 5
Any ideas on how to do this???
Code:
PARAMETERS forms!frmMain!cboManager Text ( 255 );
SELECT del_defects.SFCNUMBER, del_defects.OPERATION, del_defects.DateTimeRC, del_defects.RCACCOUNT, del_test.COMPLETE_TSTAMP, IIf(IsNull([COMPLETE_TSTAMP]),'Fail','Pass') AS TEST, SNAPMAN_EMPLOYEE.DISPLAY_NAME, tblEmployeeInfo.MGR
FROM tblEmployeeInfo INNER JOIN (SNAPMAN_EMPLOYEE INNER JOIN (del_defects LEFT JOIN del_test ON (del_defects.SFCNUMBER = del_test.SFCNUMBER) AND (del_defects.DateTimeRC = del_test.MaxOfDateTimeRC)) ON SNAPMAN_EMPLOYEE.ACCOUNTID = del_defects.RCACCOUNT) ON tblEmployeeInfo.[Employee ID] = SNAPMAN_EMPLOYEE.ACCOUNTID
WHERE (((tblEmployeeInfo.MGR)=[forms]![frmMain]![cboManager]));
Here is the crosstab itself.
Code:
TRANSFORM nz(Count([del_Summary].[SFCNUMBER]),0) AS CountOfSFCNUMBER
SELECT del_Summary.RCACCOUNT, del_Summary.DISPLAY_NAME, Count(del_Summary.SFCNUMBER) AS Total, [red][Total]*2 AS Yeild[/red]
FROM del_Summary
GROUP BY del_Summary.RCACCOUNT, del_Summary.DISPLAY_NAME
ORDER BY del_Summary.DISPLAY_NAME
PIVOT del_Summary.TEST;
What I need to do is [Total]/[Pass] but the Column heading [PASS],is what the PIVOT is on. The crosstab returns that it doesn't recognize pass as a valid field or expression.
When ran the query looks like. I just put a value in the Yield so it would run.....
RCACCOUNT DISPLAY_NAME TOTAL YIELD FAIL PASS
12345 SOME NAME 10 20 5 5
Any ideas on how to do this???