Update Query basic question

D

Dan

I have a table with 4 fields as follow:

id name Country Town
1 R NY NY
2 T KZ K1

I am trying to find an Access query that will update the table where the row
id =2 and put the following instead : 2 G TX J1

so that my table will be
id name Country Town
1 R NY NY
2 G TX J1

Any idea, thanks
Dan
 
R

Rick Brandt

Dan said:
I have a table with 4 fields as follow:

id name Country Town
1 R NY NY
2 T KZ K1

I am trying to find an Access query that will update the table where
the row id =2 and put the following instead : 2 G
TX J1

so that my table will be
id name Country Town
1 R NY NY
2 G TX J1

Any idea, thanks
Dan

UPDATE TableName
SET [name] = "G", Country = "TX", Town = "J1"
WHERE id = 2

You should really change the name of that first field as "name" is a
reserverd word. That is why I put square brackets around it.
 
N

Not_a_notes_fan

Hi Dan

Backup your data first if you are unsure!!

First create a new query in design view. Add your table to the query view.
Click on query, update query.

Add the fields from your table into the query by drag and drop. One field,
one column.

In the ID column, enter "=2" without the quotes to the criteria line. This
shows the update query to only update record 2.

Then in the other columns enter what you want to be updated.

Click on the red exclamation mark to run the update.

Hope it helps.
 

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