Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2002
    Posts
    6

    Question Unanswered: Is there an Access SQL Guru here?????

    Does anyone know if CASE is supported within a SELECT statement in Access 2000/2?

    An example would be:

    SELECT DownTimeGroup_Code = CASE WHEN DowntimeGroup_Code = 'A' THEN 'B' ELSE 'C' END
    FROM
    [Downtime]
    ;

    This SQL is just for illustration.

    If not, can anyone think of another way of performing the test and returning a result?

    The select statement is used within a Pivot table, so I'm not able to process each record individually.

  2. #2
    Join Date
    Jul 2002
    Location
    Australia
    Posts
    147
    Unfortunately CASE isn't supported in JetSQL, however you can use Nested IIF's:

    Code:
    IIF(Condition1=True, TrueAction-1, IIF(Condition2=true, TrueAction-2, IIF(Condition3=True, TrueAction-3, FalseAction-3)))
    etc.

    Alternatively, you can use PASS-THROUGH QUERIES, which bypass the Jet Engine altogether and execute the queries on SQL SERVER if your back end is on SQL Server.

    Cheers,
    Andrew
    Last edited by Bunce; 02-26-03 at 07:31.
    There have been many posts made throughout the world.
    This was one of them.

  3. #3
    Join Date
    Oct 2002
    Posts
    6

    Thank's Bunce

    I'll give that a try, looks to be what I am looking for.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •