Subject RE: [IBO] Sorting on an aggregate column
Author Alan McDonald
>
> I have a TIB_Query that uses the aggregate function MAX:
>
> SELECT
> P.NAME,
> P.BIRTHDATE,
> MAX(R.RECORDDATE) AS LASTDATE
> FROM PATIENT P, RECORDING R
> WHERE P.PATNUM = R.PATNUM
>
> I can generate an ordering item for the LASTDATE column, but
> when I try
> to sort the dataset with it, I get Dynamic SQL Error (SQL
> Error Code = - 206 column unknown LASTDATE). Am I missing something?
>

Use the orindal value instaed of the fieldname (alias)
So use 3 in place of lastdate, the orderinglinks generator will use the
alias by default you need to edit it to 3
Alan