在SQL查询中按DESC排序

时间:2015-11-30 21:30:50

标签: vb.net ms-access-2007

我在命令按钮中有一个嵌入式SQL查询,我现在需要添加一个ORDER BY [Pay_Date] DESC,以便它最新订购最新日期,但我似乎无法让它工作?这是我试过的

Private Sub Command1_Click()
    Dim strsearch As String
    Dim strText As String
    strText = Me.txtSearch.Value
    strsearch = "Select * from tblInvoiceLog where ((Vendor_Number like ""*" & strText & "*"") or (Vendor_Name like ""*" & strText & "*"") or (Invoice_1 like ""*" & strText & "*"") or (Invoice_2 like ""*" & strText & "*"") or (Invoice_3 like ""*" & strText & "*"") or (Invoice_4 like ""*" & strText & "*"") or (Invoice_5 like ""*" & strText & "*"") or (Check_Request_Total like ""*" & strText & "*"") or (Voucher_Number like ""*" & strText & "*"") or (Notes like ""*" & strText & "*"") ORDER BY ([Pay_Date] DESC))"
    Me.RecordSource = strsearch
End Sub

我收到运行时3075错误

0 个答案:

没有答案