Null Value

J

John V

I have a question regarding Null values in a table. In my table there will
be a field that contains several blanks. When I run my query I would like
all of the empty fields in this record replaced with a text value. What's
the best way to do this - preferrably without having to use VBA?

Thank you!
 
G

Guest

Run this 1st - just to check
Result: IIf(IsNull([tablename]![FieldName]),"Some text")

If the results are what you want
Run a update querry - put IsNull in the critiera row and
"SomeText" in the UpdateTo row

good luck
 
V

Van T. Dinh

Nz() function, perhaps.

--
HTH
Van T. Dinh
MVP (Access)



Wayne-I-M said:
Run this 1st - just to check
Result: IIf(IsNull([tablename]![FieldName]),"Some text")

If the results are what you want
Run a update querry - put IsNull in the critiera row and
"SomeText" in the UpdateTo row

good luck

--
Wayne
Manchester, England.



John V said:
I have a question regarding Null values in a table. In my table there
will
be a field that contains several blanks. When I run my query I would
like
all of the empty fields in this record replaced with a text value.
What's
the best way to do this - preferrably without having to use VBA?

Thank you!
 
V

Van T. Dinh

Depending on how you set up the Text Field in the Table (the Properties
"Required" and "AllowZeroLength"), you may have both Null and zero-length
String as values of this Field and both Null / ZLS appear the same to us.

To trap for both, use the condition:

Len([YourField] & "") = 0

Thus the SQL String of your Update Query should be something like:

UPDATE [YourTable]
SET [YourField] = "{NewValueHere}"
WHERE Len([YourField] & "") = 0
 

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

Top