Getting rid of zeros in a column of a table

Mojo1

Board Regular
Joined
Mar 6, 2003
Messages
148
I have an Access table that has zeros in the column. Is there a way if a record has a zero for a specific column to make it blank rather than have a zero in it?
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
If you want to do this in a query add the following to a new row:
Expr1: iif([FieldName] = 0,Null,[FieldName])

Or you can create an update query to change all the values that are 0 to Null

HTH
 
Upvote 0
Made datatype number

I changerd the data type to number and deleted the 0 from the default value, but it still shows 0 in the column.
 
Upvote 0
Update Query

Column Name is CurrentCharge.
I made an update query using the table this field is located in. I have selected only this field with iif([FieldName] = 0,Null,[FieldName]) in the criteria. Do you want me to run this?

Is there some way of using a validation rule or input mask to eliminate zero's??
 
Upvote 0
Ran the query

I ran the query and it eliminated all the zeros in tha table. Now I have some other columns with numbers for records and zeros for records within a certain field. Will the update query leave those records with numbers in them?
 
Upvote 0
Not sure what you mean by that. If you want to change the value in a table (for example 0 to blank), you create an update query, add the field you want to update to the columns are, in the Update to Filed add NULL in the Criteria filed add 0 and run the query, you should get a respone to the effect of "You are about to change XX number of records..."

If you want to change other fields you need to add them to the query and make the appropriate updates.

HTH
 
Upvote 0
Check this out

I ahve this: IIf(HOTLINE_NUM]=0,Null,[HOTLINE_NUM])
in the update to: and it completely wipes every column out. There should numbers in some records that should be left but it takes them all out. I used this update quesry like you suggested on other columns and it worked great but not with this column for some reason.
 
Upvote 0
The iif statement is supposed to be used if you want to preserve the data and just see Null in cases where there is a 0. you shouldn't use this in an update query:

ORIGINAL POST:
If you want to do this in a query add the following to a new row:
Expr1: iif([FieldName] = 0,Null,[FieldName])

Or you can create an update query to change all the values that are 0 to Null

Sorry if I confused you.
 
Upvote 0

Forum statistics

Threads
1,221,519
Messages
6,160,294
Members
451,636
Latest member
ddweller151

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