Subject | RE: [IBO] Sorting on an aggregate column |
---|---|
Author | Alan McDonald |
Post date | 2007-12-05T21:19:33Z |
>Use the orindal value instaed of the fieldname (alias)
> 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?
>
So use 3 in place of lastdate, the orderinglinks generator will use the
alias by default you need to edit it to 3
Alan