Select query and changing displayed field data

O

Ofer

Use the iif statement
SELECT IIf(IsNull([Address]) Or [Address]="","---",[Address]) AS MyAddress
FROM MyTable
 
S

Sharkbyte

In a query, you can use this in Field:

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

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

Sharkbyte
 
G

Guest

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.
 
G

Guest

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.
 
Top