Can some one please tell me where to add this part:
ORDER BY dbo_PAYROLLDB_EMP.ENAME asc
into this sql statement:
SQL1 = "SELECT DISTINCTROW dbo_PAYROLLDB_EMP.ENAME, dbo_PAYROLLDB_EMP.PAYGROUP," & _
" dbo_PAYROLLDB_EMP.STAT_CODE, dbo_PAYROLLDB_DEPT.DESCRIPT," & _
" dbo_PAYROLLDB_DEPT.DEPARTMENT, dbo_PAYROLLDB_JBDES.DESCRIPT" & _
" FROM (dbo_PAYROLLDB_EMP INNER JOIN dbo_PAYROLLDB_JBDES " & _
" ON MID(dbo_PAYROLLDB_EMP.CURPOS,6,5) = MID(dbo_PAYROLLDB_JBDES.JOBNUM,8,5)) " & _
" INNER JOIN dbo_PAYROLLDB_DEPT ON dbo_PAYROLLDB_DEPT.DEPARTMENT = dbo_PAYROLLDB_EMP.PAYGROUP" & _
" WHERE dbo_PAYROLLDB_EMP.STAT_CODE ='A' and dbo_PAYROLLDB_EMP.PAYGROUP = " & Depts.Text
Thanks in advance
ORDER BY dbo_PAYROLLDB_EMP.ENAME asc
into this sql statement:
SQL1 = "SELECT DISTINCTROW dbo_PAYROLLDB_EMP.ENAME, dbo_PAYROLLDB_EMP.PAYGROUP," & _
" dbo_PAYROLLDB_EMP.STAT_CODE, dbo_PAYROLLDB_DEPT.DESCRIPT," & _
" dbo_PAYROLLDB_DEPT.DEPARTMENT, dbo_PAYROLLDB_JBDES.DESCRIPT" & _
" FROM (dbo_PAYROLLDB_EMP INNER JOIN dbo_PAYROLLDB_JBDES " & _
" ON MID(dbo_PAYROLLDB_EMP.CURPOS,6,5) = MID(dbo_PAYROLLDB_JBDES.JOBNUM,8,5)) " & _
" INNER JOIN dbo_PAYROLLDB_DEPT ON dbo_PAYROLLDB_DEPT.DEPARTMENT = dbo_PAYROLLDB_EMP.PAYGROUP" & _
" WHERE dbo_PAYROLLDB_EMP.STAT_CODE ='A' and dbo_PAYROLLDB_EMP.PAYGROUP = " & Depts.Text
Thanks in advance