Sorting Specifically?

Benjamin Bolduc

Registered User.
Local time
Today, 11:08
Joined
Jan 4, 2002
Messages
169
Im working on a report that will sort and group items in a specific order. The problem is, these items cannot be sorted by AScending or Descending. I need it to sort them in a non-logical order. For example, here is the order:

32
12
64
9
20
16

All of the products fall into one of these number catagories and need to be listed in this order, But neither the Ascend or Descend can do it.
Any suggestions would be greatly appreciated. Thank You
smile.gif
 
You could write individual select statements for each number and union them together in the correct order.

select...where value=32
union
select...where value=12
...
 
I think you have to use 'union all'
sorry about that.
 
I needed something similar.

I created a separate table with 2 fields.
SortIDNum and DeskNum.

The DeskNum was in "illogical" order as you put it.
So I first put them in the order I needed them and used SortIDNum in "logical" order (1 through whatever)

Then I created my query and related the main table to the SortedIDNum table and in my report sorted by SortIdNum in ascending order.

(Obviously this can only work if there is a finite number of items you have in illogical order.)

Hope this makes some sense !!
 

Users who are viewing this thread

Back
Top Bottom