Похоже, вы не собираетесь делиться своими структурами и дополнительной информацией. Основываясь только на том, что у нас есть, вероятно, это то, что вы ищете:
sql = string.Format(@" SELECT
t1.assemblyno, t1.level, t1.wo_no, t1.rout_no,
t1.due_date, t1.printed, t1.rev_no, t2.lot, t2.po, t2.qty_due,
t3.comment, t3.jobno, MAX(t3.order_val), t3.part_no,t3.po,t3.price, t3.qty_order,
t3.quote_no, t3.rev_no
FROM ('{0}') t1
LEFT JOIN ('{1}') t2 on t1.wo_no = 2.wo_no
LEFT JOIN (
select * from ('{2}') tmp1
inner join
(select jobNo, max(order_val) as order_val from ('{2}') group by jobNo) tmp2
on tmp1.JobNo = tmp2.JobNo and tmp1.Order_Val=tmp2.Order_val
) t3
on t2.jobno = t3.jobno
WHERE t1.rout_no=?", databaseTable_WOROUTH, databaseTable_WOJOBS, databaseTable_SOMAST);
//cmd.Parameters.Add("@rnum", OleDbType.Char).Value = rnum;
//...
// Спасибо за идею и помощь BASOZ
var sql = string.Format(@"
select top 1
t1.assemblyno, t1.level, t1.wo_no, t1.rout_no, t1.due_date, t1.printed, t1.rev_no, t2.lot, t2.po, t2.qty_due,
t3.comment, t3.jobno, t3.order_val, t3.part_no,t3.po,t3.price, t3.qty_order,t3.quote_no, t3.rev_no
from {2} t3
inner join {1} t2 on t3.jobno = t2.jobno
inner join {0} t1 on t1.wo_no = t2.wo_no
where t1.rout_no=?
and t3.order_val in (
SELECT max(tt3.order_val)
FROM {0} tt1
left join {1} tt2
on tt1.wo_no = tt2.wo_no
left join {2} tt3
on tt2.jobno = tt3.jobno
where tt1.rout_no = ?
group by tt1.rout_no
)
{3} {4}
order by t3.jobno desc ", "t1", "t2", "t3", startCheck, endCheck);