Re: using Switch

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Duane Hookom (duanehookom_at_NO_SPAMhotmail.com)
Date: 08/11/04


Date: Tue, 10 Aug 2004 21:50:48 -0500

You might need two Switch() columns: one for Ascending and one for
Descending. You final Switch() expression pair in the Ascending would be
    True,1
This would render the first Switch() in-effective in the sorting since the
column would be all 1s. The second Switch() for descending values would then
take over.

-- 
Duane Hookom
MS Access MVP
"shank" <shank@tampabay.rr.com> wrote in message
news:OH4u8p0fEHA.3192@tk2msftngp13.phx.gbl...
> I'm trying to use Switch in an Order By clause. But having problems with
> DESC.
>
> For example: COL="orderno_desc",GenKStock.OrderNo <--works fine
> But: COL="orderno_desc",GenKStock.OrderNo DESC <-- cause an error missing
> operator
>
> How can I specify descending order?
> thanks
>
> ORDER BY Switch(COL="orderno_asc",GenKStock.OrderNo,
> COL="title_asc",GenKTitles.Title, COL="artist_asc",GenKTitles.Artist,
> COL="description_asc",GenKTitles.Description,
> COL="orderno_desc",GenKStock.OrderNo, COL="title_desc",GenKTitles.Title,
> COL="artist_desc",GenKTitles.Artist,
> COL="description_desc",GenKTitles.Description);
>
>


Relevant Pages

  • Re: using Switch
    ... Are you suggesting 2 Switch statements in the ORDER BY clause? ... You final Switchexpression pair in the Ascending would be ... The second Switchfor descending values would ...
    (microsoft.public.access.queries)
  • Re: using Switch
    ... I've never used Switch. ... The second Switchfor descending values would> then ... >> Duane Hookom ... >> MS Access MVP ...
    (microsoft.public.access.queries)
  • Re: BSOD
    ... I doubt that a mode switch on oops is a good idea. ... I think that a crash should render into ... the kernel and X uses, ...
    (Linux-Kernel)
  • Re: Quenstion on game render design
    ... >> I think the draw member should be a method of shape. ... And it would be relatively easy to switch ... > will only have to change Render class. ... > class OGLRender: public absRender ...
    (comp.games.development.programming.misc)
  • Re: DTV HDTV useful links Be ready, - dont miss a single dayof media brainwash
    ... switch of our TV airwaves to the new DTV format that will ... render our existing TV's disfunctional. ...
    (alt.guitar.amps)