Update Query?

G

Glenn Dulmage

I have two Yes\No fields in a table: Newsletter and Extra.

I would like to have a query update the Newsletter to Yes if Extra = Yes.


--

Glenn

Glenn T. Dulmage
207 Valley Road
Chestertown, MD 21620
410-778-5166
(e-mail address removed)
 
B

Bob Barrows

Glenn said:
I have two Yes\No fields in a table: Newsletter and Extra.

I would like to have a query update the Newsletter to Yes if Extra
= Yes.

Here you go:

UPDATE tablename
SET Newsletter=true
WHERE Extra=true
 
K

KARL DEWEY

BACKUP DATABASE BACKUP DATABASE
In Update To row of design view grid below Newsletter field type this --
IIF([Extra] = -1, -1, [Newsletter])
 
J

John W. Vinson

I have two Yes\No fields in a table: Newsletter and Extra.

I would like to have a query update the Newsletter to Yes if Extra = Yes.

Create a Query based on the table.
Put a criterion of True (or equivalently -1) under Extra.
Change the query to an Update query using the Query menu option or the
querytype tool in the toolbar.
Put -1 on the Update To line under Newsletter.

Run the query by clicking the ! icon.
 
G

Glenn Dulmage

Thanks - worked like a charm

Glenn

John W. Vinson said:
Create a Query based on the table.
Put a criterion of True (or equivalently -1) under Extra.
Change the query to an Update query using the Query menu option or the
querytype tool in the toolbar.
Put -1 on the Update To line under Newsletter.

Run the query by clicking the ! icon.
 

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

Similar Threads

Update Query 6
Query to capture AOL accounts 2
Table design 7
Zip Code Count 6
Count the number of occurennces of Zip Code 2
If Statement 4
Update Query 10
Update query 4

Top