Subject Re: Using params to choose the order by fields?
Author Norbert Saint Georges
> SELECT
> MEMBERS.FIRST_NAME,
> MEMBERS.SURNAME,
> MEMBERS.MEMBERID
> FROM
> MEMBERS
> WHERE
> MEMBERS.CLUBID = :CID
> ORDER BY
> CASE :OBC
> WHEN 1 THEN MEMBERS.SURNAME
> WHEN 2 THEN MEMBERS.FIRST_NAME
> END;
>
>
> The above works, but if I put in 2 fields as below, I get an error.
>
>
ORDER BY
CASE :OBC
WHEN 1 THEN MEMBERS.SURNAME
WHEN 2 THEN MEMBERS.FIRST_NAME
END;
,
CASE :OBC
WHEN 1 THEN MEMBERS.FIRST_NAME
WHEN 2 THEN MEMBERS.SURNAME
END;

--
Norbert Saint Georges
http://tetrasys.fi