Change a value of 1 to YES

sql server linked table - "Detail_YORN" - (nvarchar(5)   text in access

In a query :
I have a field called  "Detail_YORN"
I need to change the Value of "1" to "YES"
change the value of "2" to "NO"

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Paul MacDonaldDirector, Information SystemsCommented:
Something like...

        WHEN Detail_YORN = 1 THEN 'YES'
        ELSE 'NO'
    END AS YorNAnswer
FROM table
Fabrice LambertFabrice LambertCommented:

Run 2 update queries:

SET Detail_YORN = 'YES'
WHERE Detail_YORN = '1'

Same goes for the "NO" values, change the query accordingly.
FordraidersAuthor Commented:
got this to work also in the query
=IIf([Detail_YORN] = True, "Yes", "No")  In the criteria for the field i'm trying to change the value.

Fabrice LambertFabrice LambertCommented:
Well, keep in mind that most of the time, computers deal with boolean values as follow:
- 0 is False.
- If it isn't False, then it is True.
- Usually, True is -1 by default.

And since your Detail_YORN field is a text field, comparing it with a boolean make no sens.

The following will work better:
=IIf([Detail_YORN] = "1", "Yes", "No")

But beware that any value different from "1" will be replaced by "False".
If that isn't your desired results, the iif operator isn't the solution you need.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
FordraidersAuthor Commented:
Thanks very much !
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.