MySql.Data.MySqlClient.MySqlException

时间:2015-12-29 01:28:30

标签: mysql vb.net rdlc

美好的一天!有人可以帮我弄这个吗?我无法弄清楚出现此错误的原因。我该怎么办?

  

"您的SQL语法出错了;检查手册   对应于您的MySQL服务器版本,以便使用正确的语法   靠近')和cdr_datetime BETWEEN' 2015-01-01 12:00:00' AND' 2015-12-29   23:59:59'组'在第18行"

这是我的代码:

Case "employeewithoutdestination"
    Dim newparams(3) As ReportParameter
        newparams(0) = New ReportParameter("CallClassCode", callClassCode)
        newparams(1) = New ReportParameter("DateTimeFrom", startDateTime)
        newparams(2) = New ReportParameter("DateTimeTo", endDateTime)
        newparams(3) = New ReportParameter("Vat", vat)
       rvScreen.LocalReport.SetParameters(newparams)
       rvScreen.LocalReport.Refresh()

    Dim rdsEmployeeWithoutDestination As New ReportDataSource
    Dim daEmployeeWithoutDestination As New EmployeeWithoutDestinationTableAdapter
    Dim dtEmployeeWithoutDestination As New EmployeeWithoutDestinationDataTable

    If String.IsNullOrEmpty(reportFilter) Then
      daEmployeeWithoutDestination.SetWhereClause(String.Format("cdr_site_id = '{0}' and a.employee_id in ({1}) and cdr_datetime BETWEEN '{2}' AND '{3}' group by cdr_date,cdr_time,cdr_call_type_code ORDER BY employee_name", siteId, employeeId, startDateTime, endDateTime))
    Else
      daEmployeeWithoutDestination.SetWhereClause(String.Format("cdr_site_id = '{0}' and a.employee_id in ({1}) and cdr_datetime BETWEEN '{2}' AND '{3}' group by cdr_date,cdr_time,cdr_call_type_code ORDER BY employee_name", siteId, employeeId, startDateTime, endDateTime))
    End If

      daEmployeeWithoutDestination.Fill(dtEmployeeWithoutDestination)

      rdsEmployeeWithoutDestination.Name = "LCSRDBDataSet_EmployeeWithoutDestination"
      rdsEmployeeWithoutDestination.Value = dtEmployeeWithoutDestination
      rvScreen.LocalReport.DataSources.Add(rdsEmployeeWithoutDestination)

error

提前致谢。

0 个答案:

没有答案