You cannot order by expression, unless it evaluates to a field number. You can add extra field to order on to the field list and use that query as derived table for outer query where you'll strip it.
>This is a section of SQL. I need the results in the order below. I am unable to have any additional fields in the result cursor than what is already in the SQL. I've been unable to do anything with the ORDER clause that didn't return an error. How can I do this?
>
>Desired Order:
>
>P = 1
>S = 2
>T = 3
>A = 4
>W = 5
>
>
>PADR(THIS.Strip(TRANSFORM(;
> IIF(Covr.CvPS='P','Primary',;
> IIF(Covr.CvPS='S','Secondary',;
> IIF(Covr.CvPS='T','Tertiary',;
> IIF(Covr.CvPS='A','Auto',;
> IIF(Covr.CvPS='W','Workmans Compensation','Other))))), '@T')), 30, ' ') ;
> AS IN1_22_00_Coord_of_Benefit_Priority
>
--sb--