Re: using Switch
From: Duane Hookom (duanehookom_at_NO_SPAMhotmail.com)
Date: 08/11/04
- Next message: Ken Snell: "Re: need help with a relatively simple criteria expression"
- Previous message: John Baker: "Re: outputting memo fields to excel"
- In reply to: shank: "using Switch"
- Next in thread: shank: "Re: using Switch"
- Reply: shank: "Re: using Switch"
- Messages sorted by: [ date ] [ thread ]
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); > >
- Next message: Ken Snell: "Re: need help with a relatively simple criteria expression"
- Previous message: John Baker: "Re: outputting memo fields to excel"
- In reply to: shank: "using Switch"
- Next in thread: shank: "Re: using Switch"
- Reply: shank: "Re: using Switch"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|