[firebird-support] Re: Using params to choose the order by fields?

2019-10-10 Thread p...@coshott.com [firebird-support]
Hi Norbert,
 

 Thanks for the answer. Just one little thing in case anyone else needs to do 
this. The ; after the "END" in the first case statement should not be there.
 

 But otherwise works perfect.
 

 Cheers,
 Paul



[firebird-support] Re: Using params to choose the order by fields?

2019-10-08 Thread Norbert Saint Georges n...@tetrasys.eu [firebird-support]
> 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







++

Visit http://www.firebirdsql.org and click the Documentation item
on the main (top) menu.  Try FAQ and other links from the left-side menu there.

Also search the knowledgebases at http://www.ibphoenix.com/resources/documents/ 

++


Yahoo Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/firebird-support/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/firebird-support/join
(Yahoo! ID required)

<*> To change settings via email:
firebird-support-dig...@yahoogroups.com 
firebird-support-fullfeatu...@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
firebird-support-unsubscr...@yahoogroups.com

<*> Your use of Yahoo Groups is subject to:
https://info.yahoo.com/legal/us/yahoo/utos/terms/