Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Order ascending

Status
Not open for further replies.

KMinor

MIS
Jun 7, 2001
3
US
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
 
At the end of the statement:

[tt]... " WHERE dbo_PAYROLLDB_EMP.STAT_CODE ='A' and dbo_PAYROLLDB_EMP.PAYGROUP = " & _
Depts.Text & " ORDER BY dbo_PAYROLLDB_EMP.ENAME"[/tt]

Roy-Vidar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top