Select query and changing displayed field data

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Use the iif statement
SELECT IIf(IsNull([Address]) Or [Address]="","---",[Address]) AS MyAddress
FROM MyTable
 
In a query, you can use this in Field:

Expr1: IIf(isnull([Address1]),"----",[Address1])

This will display the '----' whenever the record is empty.

Sharkbyte
 
I have a select query.

It searches on a field which has a number it it. This works fine.

Sometimes some of the other fields lets say an Address field is empty. Can I
in my query put in some criteria in this field that says

If this field is empty then put a --- line in it. I export the field and
want something displayed here.

I have no idea what the right way to write it would be but perhaps this
gives you an idea of what I want.

if null then
field = "---"
end if

Kinda like that. Remember this is not the field Im searching on its just a
viewed field.
 
Thanks all for your help.

Regards

Sharkbyte said:
In a query, you can use this in Field:

Expr1: IIf(isnull([Address1]),"----",[Address1])

This will display the '----' whenever the record is empty.

Sharkbyte



I have a select query.

It searches on a field which has a number it it. This works fine.

Sometimes some of the other fields lets say an Address field is empty. Can I
in my query put in some criteria in this field that says

If this field is empty then put a --- line in it. I export the field and
want something displayed here.

I have no idea what the right way to write it would be but perhaps this
gives you an idea of what I want.

if null then
field = "---"
end if

Kinda like that. Remember this is not the field Im searching on its just a
viewed field.
 

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

Back
Top