Hallo Carsten
den SQL muß ich in Access anwenden(Aktualisierungsabfrage).
Den case-Befehl habe ich in der Access-Hilfe nicht gefunden!
Da gibts schon was entsprechendes:
http://support.microsoft.com/newsgroups/newsReader.a…
Zitat:
Gerald Stanley
11/10/2004 12:48 PM PST
RE: Select case instruction in access query
In: microsoft.public.access.queries
You could have a look at the Switch function. Your example would look
something like
SELECT Switch(type = ‚popular_comp‘ , ‚Popular Computing‘ , type =
‚mod_cook‘ , ‚Modern Cooking‘ , type = ‚business‘ , ‚Business‘ , type =
‚psychology‘ , ‚Psychology‘ , type = ‚trad_cook‘ , ‚Traditional Cooking‘ ,
True, ‚Not yet categorized‘) As category etc
Hope This Helps
Gerald Stanley MCSD
„Herbert Saal“ wrote:
> Is there an instruction in access similar to the CASE Instruction in Transac
> SQL?
>
> Ex:
> USE pubs
> GO
> SELECT Category =
> CASE type
> WHEN ‚popular_comp‘ THEN ‚Popular Computing‘
> WHEN ‚mod_cook‘ THEN ‚Modern Cooking‘
> WHEN ‚business‘ THEN ‚Business‘
> WHEN ‚psychology‘ THEN ‚Psychology‘
> WHEN ‚trad_cook‘ THEN ‚Traditional Cooking‘
> ELSE ‚Not yet categorized‘
> END,
> CAST(title AS varchar(25)) AS ‚Shortened Title‘,
> price AS Price
> FROM titles
> WHERE price IS NOT NULL
> ORDER BY type, price
> COMPUTE AVG(price) BY type
> GO
> Thanks in advance,Herbert Saal
>
>
>