Query Help ..... PLEASE!

turtle

New Member
Joined
Feb 25, 2003
Messages
33
Hello,

I have an MS Access with 5 fields. The second field labeled area. I have about 1000 records out of that only about 400 have an actual value in the second field (area). I want to write a query that will select all the records that have the second field empty and then automatically fill in those empty records with "home" as the area.

So as an overview what I need is a query that will put the word home in the area field if it is blank.

This field is a text value.

Thank You
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Try something like:

Area1: IIf(IsNull([Area]),"home",[Area])

Place this in the Field of the Query Design Window.

HTH,
CT
 
Upvote 0
CT Witter's answer is useful if you want to add another field to a query. However, if you want to permanently modify the data you need an Update query.
Do this:
1. Create a query with just one field: the field you want to update.
2. In the Criteria row of the query grid, below the field with the null data, type Is Null
3. Now, under the Query menu, select Update Query. You'll get another row in the grid called Update. In the null data field, type "Home" (with the quotes)
OK, now to check. Go to Datasheet view. You should see one column with no data -- these are the records with Nulls. Save and close the query.
To run the query, double-click the icon. You will get a warning about updating (or modifying) X number of records. Click OK and you have "Home" in all the blanks.
You can run the query periodically to fill in the blanks, or alternatively you could go into design view in the table, select the field in the top half of the view, and in the bottom enter "Home" as the default value.

HTH
Denis
 
Upvote 0

Forum statistics

Threads
1,221,631
Messages
6,160,942
Members
451,679
Latest member
BlueH1

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