Case statement in query ?

D

David

I need to change the values returned by my query for a
certain column. I am reducing the values to a subset of
the original values by consolidating some values into one.
What is the best way to do this? Is there a CASE statement
I can use? My tests will need something like the LIKE
statement and also need to have an ELSE option.
 
A

Allen Browne

Try the Switch() function, and use True to introduce the Else, e.g.:
Switch([Surname] like "A*", "Starts with A", True, "Didn't match")

If it's not powerful enough, you can write your own function and call that.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top