Morning,I have a request for a report that says read from the bottom. When the status = Started then show that work center. When there is no started status find one where the status is Completed and show the first Open one after that. An example would be this one:Workcenter Status operationPC DRWPART COMPLETED 90912DT MSG325 STARTED 90921fc OPTICAL OPEN 90922QC CMM OPEN 90923PP POSTPOL OPEN 90924QC GENERAL OPEN 90925EPNE OPEN 90926QC GENERAL OPEN 90927CT ENVR OPEN 90928QC GENERAL OPEN 90929
What should happen is that the DT MSG325 is selected. But what is happening is the FC optical is being selected. I have this for the code:select top 1casewhen status = 'S' then (select top 1 Work_Center from Job_Operation where Status = 'S' and job = j.job order by Job_Operation desc)when Status = 'O' then (select top 1 Work_Center from Job_Operation where Status = 'O' and job = j.job order by Job_Operation)end wc from Job_Operation jwhere j.job = '405432'order by Job_Operation desc
I think I'm close but any thoughts would be great.Thanks so muchLaura