Try aliasing your table columns. ORDER BY only looks at the final recordset,
so depending on which DB you're using, it might be ignoring your ORDER BY.


SELECT 
        users.userID AS userID,
        users.lastName AS lastName,
        departments.deptName AS departmentName
FROM users,departments
WHERE users.deptID = departments.deptID
ORDER BY departmentName


> -----Original Message-----
> From: Angel Stewart [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, September 03, 2002 1:52 PM
> To: CF-Community
> Subject: Why ain't it sorting?
> 
> 
> Hey all,
> 
> I think I'm having some temporary cognitive failure hee hee
> 
> Whats wrong with this SQL?
> 
> -------------
> Select
> Team_Tbl.Service_Area,Team_Tbl.Cost_Center_Cd,Team_Tbl.Cost_Ce
> nter_Desc,
>       
> tblServiceArea.Service_Area,tblServiceArea.Service_Area_Desc 
>               FROM tblServiceArea,Team_Tbl
>               
>               WHERE 
>               tblServiceArea.Service_Area = Team_TBL.Service_Area
> 
>               
>               ORDER BY Trim(tblServiceArea.Service_Area_Desc)
> ---------------
> 
> 
> Umm..simple Order By statemnet...but it just doesn't sort. 
> It spits the records out in any old order...going from C to A then to
> W..then T....I mean..what am I doing wrong? I know I gotta be doing
> SOMETHING wrong..Just don't know what.
> 
> ^_^
> 
> -Gel
> 
> 
______________________________________________________________________
Get the mailserver that powers this list at http://www.coolfusion.com

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to