** 請教各位高手:
我在VBA中如下連接mysql單表查詢沒問題,有數據出來。
**
.CommandText = Array( _
"select " _
& "proc_hist_0.prod_pn , proc_hist_0.LOT_NO, proc_hist_0.proc_ID, proc_hist_0.IN_TIME, proc_hist_0.IN_QTY, proc_hist_0.OUT_TIME, proc_hist_0.OUT_QTY " _
& "FROM proc_hist proc_hist_0 " _
& "WHERE " _
& "proc_hist_0.co_code='" & mrpc & "' and proc_hist_0.PROD_PN='" & itnr & "' ")
**但是增加一個表左連接后就不行,報錯:執行階段錯誤'13' 型態不符合 。
**
如下代碼,請幫忙看看錯在哪裡:
.CommandText = Array( _ "select " _ & "proc_hist_0.prod_pn , proc_hist_0.LOT_NO, proc_hist_0.proc_ID, proc_hist_0.IN_TIME, proc_hist_0.IN_QTY, proc_hist_0.OUT_TIME, proc_hist_0.OUT_QTY " _ & "FROM proc_hist proc_hist_0 " _ & "Left Join " _ & "proc_para proc_para_0 " _ & "On " _ & "proc_hist_0.co_code = proc_para_0.co_code " _ & "and " _ & "proc_hist_0.wip_id = proc_para_0.wip_id " _ & "and " _ & "proc_hist_0.proc_ref = proc_para_0.proc_ref " _ & "WHERE " _ & "proc_hist_0.co_code='" & mrpc & "' and proc_hist_0.PROD_PN='" & itnr & "' ")
声明:本网页内容旨在传播知识,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。TEL:177 7030 7066 E-MAIL:11247931@qq.com