Subject Re: [IBO] Sorting on Lookup Fields
Author Jay
Piece of cake

In your sort order you must specify the position number of your result
rather than the name you use.
In your case the ordering item should read "YourUserName=3; 3 DESC"
because it's the third field.
Btw. The name part of the ordering item does really matter as I have
found.

Cheers

Johannes

Johan Kotze wrote:

> I have two tables where I need to lookup some value from the second
> table to display in a grid alongside values from my primaty table.
> Everything works and the lookup displays the correct values. My
> problem is that I want to sort on the "looked up" values. My table
> looks as follows:
>
> SELECT SERIALNR
> , MODELNAME
> , (SELECT DISPLAYNAME FROM GEBRUIKERS WHERE
> GEBRUIKERS.INDEKS=STOCK.GEBRUIKER) AS USER_NAME
> ....
>
> If I set up the Orderlinks property to sort on the USER_NAME field, I
> get an error that the field does not exist. Am I doing something
> wrong or is it supposed to work this way.
>
> Johan Kotze