Update Nulls to N/A

  • Thread starter Gaetanm via AccessMonster.com
  • Start date
G

Gaetanm via AccessMonster.com

I have a data base that some fields that are Null and I would like to fill
those
with N/A

I tried to do an update query but comes back with syntax error can someone
please help.

My table is PARTS, the field is PART# and I want to change all the NULLS in
PART# to N/A

UPDATE Parts
SET Part# = N/A
WHERE Part# is Null;

Thanks
Gaetanm
 
M

Michel Walsh

UPDATE parts
SET [part#] = "N/A"
WHERE [part#] IS NULL




that assumes [part#] is a string (Jet-text, or varchar() ).


You can always try to FORMAT the field [part#]. That depends on where you
use it.


? Format( 1.2, "#;-#;zero;N/A"), Format( -1.2, "#;-#;zero;N/A"), Format( 0,
"#;-#;zero;N/A") , Format( null, "#;-#;zero;N/A")
1 -1 zero
N/A



Vanderghast, Access MVP
 
G

Gaetanm via AccessMonster.com

Michael
Thank you for your quick responce. That worked well. the quotes on N/A was
missing
and of course [ ] always help

Thanks again

Gaetanm

Michel said:
UPDATE parts
SET [part#] = "N/A"
WHERE [part#] IS NULL

that assumes [part#] is a string (Jet-text, or varchar() ).

You can always try to FORMAT the field [part#]. That depends on where you
use it.

? Format( 1.2, "#;-#;zero;N/A"), Format( -1.2, "#;-#;zero;N/A"), Format( 0,
"#;-#;zero;N/A") , Format( null, "#;-#;zero;N/A")
1 -1 zero
N/A

Vanderghast, Access MVP
I have a data base that some fields that are Null and I would like to fill
those
[quoted text clipped - 13 lines]
Thanks
Gaetanm
 

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