View Full Version : Custom Sort Problem


keith123
03-02-2005, 08:49 AM
I have a report that is Query based. What I need to do is sort the "Rank" field by the highest rank downwards. These ranks will be coming from a employee's details table. The report generates who worked on a certain project.

Example:

Project Manager
Assistant Project Manager
Snr Engineer
Jnr Engineer
etc...

If the answer is a code based one please give me an example.

Any help would be appreciated.

Thx
Keith

Oyster
03-02-2005, 09:28 AM
You'll probaly have to add a "Rank" indicator to your table for each job title:
Rank.............JobTitle
5..................Project Manager
4..................Assistant Project Manager
and so on

SELECT [JobTitle]
FROM [JobTitleTable]
ORDER BY [Rank] DESC;

keith123
03-03-2005, 01:44 AM
Super Thanks!!

ChubbChubb
11-25-2005, 08:58 AM
Rather than adding an additional column to your table, you could use the Switch function in a Query.

There's a how-to for doing this on one of Microsoft's help pages:
ACC2000: How to Create a Custom Sort Order (http://support.microsoft.com/default.aspx?scid=kb;en-us;304564)