Last post Dec 19, 2016 05:34 AM by Chris Zhao
Dec 14, 2016 07:08 PM|Ruthless23|LINK
I have a table that has multiple records of data collection data based on processes used on a job
These processes are assigned to a cost center in another table
When a user complete a process they can up a value in a COMPLETE field indicating that the process is complete, not complete or Cost Center complete
meaning no more work is required in cost center.
I want to exclude a cost enter from the results if any ONE of the records in the data collection table has a C in the complete field.
bbjobcst holds the data collection records.
ssproces hold the process number and cost center number
This does not work:
INNER JOIN dbo.SSPROCES ON dbo.BBJOBCST.PROCNO = dbo.SSPROCES.PROCNO
WHERE (dbo.BBJOBCST.LJOB > 0)
AND NOT EXISTS (
FROM BBJOBCST AS bbjc
Join SSPROCES SSP on bbjc.PROCNO=ssp.PROCNO
WHERE bbjobcst.LJOB = bbjc.LJOB
AND ssproces.PROCNO = bbjc.PROCNO
AND bbjc.COMPLETE = 'C'
Dec 19, 2016 05:34 AM|Chris Zhao|LINK
FROM dbo.BBJOBCST AS bbjc
INNER JOIN dbo.SSPROCES as ssp ON bbjc.PROCNO = ssp.PROCNO
WHERE bbjc.LJOB > 0
AND bbjc.COMPLETE != 'C'