欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  数据库

mysql-執行階段錯誤'13' 型態不符合 ----VBA 連接MYSQL多表查詢

程序员文章站 2022-05-02 18:00:52
...
mysqlvba

** 請教各位高手:

我在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 & "' ")
相关标签: mysql vba