Case Statement in Access

  • Can you use a case statement in Access 2003?

  • Where do you want to use it?

    It's not available in Access SQL (AFAIK), but it is available in VBA. Or if you use a passthru query to a SQL Server db, it's also OK.

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • For Access SQL use either the IIF( <condition>, <true expression>, <false expression> ), which can be nested (that is the condition or the true/false expresssions can also be IIF's),  or use the Choose( <number>, <expression when 1>, <expression when 2>, ..., <expression when n> ) function to return an expression from the value of the number.

    If using VBA try the Select Case ... End Case statement.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply