Dim strSQL As String
strSQL = " select rtrim(TB001) TB001 " _
& " ,rtrim(TB005) TB005, SUM(TB007) TB007, TB008, TB009, MB002,
MB003, MB004 " _
& " from LRPTB b " _
& " inner join LRPTA a on b.TB001= TA001 AND TB002 = TA002 " _
& " inner join INVMB on MB001= TB005 " _
LRPTA和TB不是製令的table喔, 製令應該是MOCTA和TB才對,LRP是供應需求物料計算用,有可能同一品號因為不同原因而展出多筆, 加總上有可能重複..