8

I would like to show the value "NONE" if the value in a field is null OR its value if the field is not null from a table using select statement. The statement may be similar to this:

select iif(isnull(spouse),"NONE",spouse) as spouse from biodata
1
  • 1
    Well, there's a name conflict, in that the alias is the same name as the underlying field. To work, it would have to be more specific: IIf(IsNull(biodata.spouse),"NONE",biodata.spouse) As spouse Commented Aug 3, 2011 at 21:07

1 Answer 1

14
SELECT Nz(spouse,"NONE") AS Nzspouse FROM biodata

Nz() replaces spouse with "NONE" if spouse was NULL, otherwise it returns spouse.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.