SELECT (select count(r2.job_no) from dt_report r2 where( r.date_error >= r2.date_error) and r2.cause_no = 'CCR' and date_error between #1/1/2010# and #12/31/2010#), r.job_no, r.part_no,p.part_name,r.remark,r.date_error, r.qty, r.ac_cost, a.actor_name
FROM (dt_report r INNER JOIN dt_actor a ON r.actor_no = a.actor_no) INNER JOIN dt_part p ON r.part_no = p.part_no
where cause_no = 'CCR' and date_error between #1/1/2010# and #12/31/2010# order by r.date_error;
SELECT (SELECT COUNT(r2.job_no) FROM dt_report r2 WHERE( r.date_error >= r2.date_error) AND r2.cause_no = 'CCR' AND date_error BETWEEN #1/1/2010# AND #12/31/2010#), r.job_no, r.part_no,p.part_name,r.remark,r.date_error, r.qty, r.ac_cost, a.actor_name
FROM dt_report r, dt_actor a, dt_part p
WHERE r.actor_no = a.actor_no AND r.part_no = p.part_no AND cause_no = 'CCR' AND date_error between #1/1/2010# AND #12/31/2010# ORDER BY r.date_error;
SELECT (select count(r2.job_no) from dt_report r2 where( r.job_no >= r2.job_no) and r2.line_no='AWM' and r2.cause_no='CCR' ), r.job_no, r.part_no,p.part_name,r.remark,r.date_error, r.qty, r.ac_cost, a.actor_name
FROM (dt_report r INNER JOIN dt_actor a ON r.actor_no = a.actor_no) INNER JOIN dt_part p ON r.part_no = p.part_no
where r.cause_no = 'CCR' and (r.date_error between #1/1/2010# and #12/31/2010#) and r.line_no = 'AWM' order by r.job_no;