Link to home
Start Free TrialLog in
Avatar of Fordraiders
FordraidersFlag for United States of America

asked on

need to change a value to <blank> if the word is "NO"

need to change a value to <blank> if the word is "NO"

I have this field, which has the "YES" or "NO" values.

If the value  =  "Yes" bring back a "Yes"
if the value  = "NO" bring back  nothing  


[PayTermsTiedVolCommi] as 'Payment Terms tied to VC Performance'



Thanks
fordraiders
ASKER CERTIFIED SOLUTION
Avatar of Jim Horn
Jim Horn
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
If by "<blank>" you mean an empty string, and the column ONLY contains "yes" or "no":

SELECT
              CASE [PayTermsTiedVolCommi]
                    WHEN 'NO' THEN ''
                   ELSE  [PayTermsTiedVolCommi]
             END as 'Payment Terms tied to VC Performance'
FROM   table ....

... or ...

SELECT IIF([PayTermsTiedVolCommi]  = 'No','',[PayTermsTiedVolCommi] ) as 'Payment Terms tied to VC Performance'
you can surely use a case statement:
select *, case when YourField = 'No' then '' else YourField end as NewYourField

Open in new window

If you want to avoid a CASE and/or if the column could also be NULL, this would handle both NULL and NO being set to '':

ISNULL(NULLIF([PayTermsTiedVolCommi], 'NO'), '') as 'Payment Terms tied to VC Performance'
Avatar of Fordraiders

ASKER

thanks all...