If then else if else if

D

deb

I need an IF statement in a query.
I want the new field to be called Rating.

I have a field called Status.
If status is "R" then rating should be -1
If status is "G" then rating should be 1
if status is "W" then rating should be 0

How do I put this in a query?

Thanks
 
D

Douglas J. Steele

Switch(Status = "R", -1, Status= "G", 1, Status = "W", 0)

(Of course, you'd probably be better off putting those three details in a
table, and joining that table to the rest of your query)
 

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