以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [求助] Select出现错误了  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=152406)

--  作者:susanhe
--  发布时间:2020/7/11 22:06:00
--  [求助] Select出现错误了

老师,如图出错了,请帮忙,谢谢。



    Dim cmd6 As new SQLCommand
    cmd6.C
    cmd6.CommandText = "S elect max({ICStockBill}.[FDate]) From ({ICStockBillEntry} Inner JOIN {t_Item} ON {t_Item}.[FItemID] = {ICStockBillEntry}.[FItemID]) Inner JOIN {ICStockBill} ON {ICStockBill}.[FInterID] = {ICStockBillEntry}.[FInterID] Where {ICStockBill}.[FBillNo] like \'%WIN%\' and {ICStockBillEntry}.[FItemID]) =\'" & rrr("PartNo") &"\'"
    Dim Values6 = cmd6.ExecuteValues
    If Values6.Count > 0 Then
        rrr("TotalVatRrice") = Values6("FPrice")
    End If

图片点击可在新窗口打开查看此主题相关图片如下:捕获.png
图片点击可在新窗口打开查看


--  作者:linyunu
--  发布时间:2020/7/12 11:30:00
--  

    cmd6.CommandText = "S elect top 1 [FPrice] From ({ICStockBillEntry} Inner JOIN {t_Item} ON {t_Item}.[FItemID] = {ICStockBillEntry}.[FItemID]) Inner JOIN {ICStockBill} ON {ICStockBill}.[FInterID] = {ICStockBillEntry}.[FInterID] Where {ICStockBill}.[FBillNo] like \'%WIN%\' and {ICStockBillEntry}.[FItemID]) =\'" & rrr("PartNo") &"\' order by {ICStockBill}.[FDate] desc"
    Dim Values6 = cmd6.ExecuteValues
    If Values6.Count > 0 Then
        rrr("TotalVatRrice") = Values6("FPrice")
    End If
--  作者:susanhe
--  发布时间:2020/7/12 19:53:00
--  
你好,也出现了这个问题。如图。
图片点击可在新窗口打开查看此主题相关图片如下:捕获.png
图片点击可在新窗口打开查看

--  作者:linyunu
--  发布时间:2020/7/12 20:51:00
--  
cmd6.CommandText = "S elect top 1 [FPrice] From {ICStockBillEntry} Inner JOIN {t_Item} ON {t_Item}.[FItemID] = {ICStockBillEntry}.[FItemID]) Inner JOIN {ICStockBill} ON {ICStockBill}.[FInterID] = {ICStockBillEntry}.[FInterID] Where {ICStockBill}.[FBillNo] like \'%WIN%\' and {ICStockBillEntry}.[FItemID] =\'" & rrr("PartNo") &"\' order by {ICStockBill}.[FDate] desc"