I have a report with no groupings and no sorting specified in the actual report...and I am getting weird results.I have to sort by a PROJECT.CATEGORY type, but not in alphabetical order...The product categories are:EngineTransmissionAxle,Test,Service,InstallThey want them in that order...so I tried to use the charindex() to do the sort:CREATE PROCEDURE rsp_overdue_projectsASBEGINSET NOCOUNT ONdeclare @order varchar(100)set @order = ',Engine, Transmission, Axle, Test, Service, Install,'Select PROJECT.CATEGORY, PROJ_TASK.TEXT_26, PROJECT.PROJECTNAME, PROJECT.SUBJECT, PROJECT.AUTHOR, PROJECT.MANAGER_ID, PROJ_TASK.NAME FROM PROJ_TASKLEFT JOIN PROJECT ON PROJECT.PROJECTID=PROJ_TASK.PROJECTIDWHERE (PROJ_TASK.NAME Like '%Tear%' AND PROJ_TASK.CONTRACTUAL_MS = 2 AND PROJ_TASK.COLOR=255)OR ((PROJ_TASK.PROJECTNAME LIKE '%SE' OR PROJECT.AUTHOR = 'SERVICE') AND PROJ_TASK.TASK_TYPE=3 AND PROJ_TASK.COLOR = 255)order by charindex ( ','+CATEGORY+',', @order) DESC --, PROJECT.SUBJECT, PROJECT.MANAGER_ID, PROJECT.AUTHORSet NOCOUNT OFFEndGO
That did not work...I also got rid of the DESC in the above procedure, and that too did not work.Can I get any assistance in this so I can get the sort properly worked out. The sort should be first by that Category listed above, then by : PROJECT.SUBJECT, PROJECT.MANAGER_ID, PROJECT.AUTHORWhich I have commented out for now, but will eventually need it. Again there is no groupings in my report so not sure why this is not working.Thanks,Jon
Keeping the web experience alive -- [url]http://www.web-impulse.com[/url]Imperfection living for perfection -- [url]http://jhermiz.blogspot.com/[/url]