Access table changing fields from null to 0

Enchantix

New Member
Joined
Sep 20, 2015
Messages
34
hello,

ive been trying to figure out how to solve this problem with luck,

ive added a new field (column) to my data table in access 2010 and it has about 7300 records in it.

i would like to change all the blank cells in this new field (column) from blank or null to "0".

find and replace doesnt seem to work and im not too sure on the NZ function and how to do it.

ive also copied the data table to excel and changed all the fields to 0 and when i tried to paste it, i was given an error saying clipboard data is damaged and could not be pasted...


if anyone can help that would be greatly appreciated.
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Couldn't you use an update query with Is Null in the criteria?

Something like this.

UPDATE Table1 SET city.Field1 = "0"
WHERE Table1.Field1 Is Null;
 
Upvote 0
Note. If you want to set it to a value of zero, you don't need the quotes around the zero (quotes are usually reserved for text values, not numeric ones).
 
Upvote 0
Joe4

I've assumed it's a text field as I don't think numeric fields can be Null.
 
Upvote 0
I've assumed it's a text field as I don't think numeric fields can be Null.
Sure they can. I have come across many instances where they are.
Just to note, the code will work with the double-quotes in there, even if the field is numeric. Access seems smart enough to coerce it to a number.
But it is always good to understand when to use/not use them (which is why I made that comment, for the OP's benefit).
 
Upvote 0
Ach, your right - I was just thinking that a numeric field couldn't be Null because they don't have the Allow Zero Length option.
 
Upvote 0

Forum statistics

Threads
1,221,811
Messages
6,162,109
Members
451,743
Latest member
matt3388

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top