select a.file_job, Cntr=count(cont_num), CntrOut=count(date_out), CntrIn=count(date_in), Status=''
from cargodetailcontainer a join cargodetail b on a.file_job=b.file_job
group by a.file_job
order by a.file_job
If all three column value is equle (Cntr=count(cont_num), CntrOut=count(date_out), CntrIn=count(date_in)) then on status (last cloumn) I have to show "Closed" else "Open"
In this FREE six-day email course, you'll learn from Janis Griffin, Database Performance Evangelist. She'll teach 12 steps that you can use to optimize your queries as much as possible and see measurable results in your work. Get started today!