Can someone please tell me why I keep getting this error when running this sql statement:
Invalid syntax near '.'.
SQL1 = "SELECT dbo.PAYROLLDB_EMP.ENAME, dbo.PAYROLLDB_EMP.DEPARTMENT, dbo.PAYROLLDB_JBDES.DESCRIPT" & _
"FROM dbo.PAYROLLDB_EMP INNER JOIN dbo.PAYROLLDB_JBDES ON SUBSTRING(dbo.PAYROLLDB_EMP.CURPOS,6,5) = SUBSTRING(dbo.PAYROLLDB_JBDES.JOBNUM,5)" & _
"WHERE [DEPARTMENT] = " & Depts.Text
Invalid syntax near '.'.
SQL1 = "SELECT dbo.PAYROLLDB_EMP.ENAME, dbo.PAYROLLDB_EMP.DEPARTMENT, dbo.PAYROLLDB_JBDES.DESCRIPT" & _
"FROM dbo.PAYROLLDB_EMP INNER JOIN dbo.PAYROLLDB_JBDES ON SUBSTRING(dbo.PAYROLLDB_EMP.CURPOS,6,5) = SUBSTRING(dbo.PAYROLLDB_JBDES.JOBNUM,5)" & _
"WHERE [DEPARTMENT] = " & Depts.Text