Update Query

D

David M C

I have two tables:

ScheduleOfRates:

SORCode (pk)
Description
Unit
Rate
SMV (currently empty)

NewRates:

SORCode (pk)
Description
Unit
Rate
SMV

I would like to update the SMV field in ScheduleOfRates using the SMV field
in NewRates where the SORCode matches. How can I do this?

Thanks,

Dave
 
J

John Spencer

First, backup your data. You cannot undo this other than by restoring from
a backup.

In the query grid:
--Add both tables to a query
--Join the tables by dragging SORCode to SORCode
--Add the field ScheduleOfRates.SMV to the list of fields
--Select Query: Update from the menu
--In the update to row, enter
[NewRates].[SMV]
--Select Query: Run from the menu

SQL statement would look like
UPDATE ScheduleOfRates INNER JOIN NewRates
ON ScheduleOfRates.SORCode = NewRates.SORCode
SET ScheduleOfRates.SMV = NewRates.SMV
 
D

David M C

Thanks. Worked Perfectly.

John Spencer said:
First, backup your data. You cannot undo this other than by restoring from
a backup.

In the query grid:
--Add both tables to a query
--Join the tables by dragging SORCode to SORCode
--Add the field ScheduleOfRates.SMV to the list of fields
--Select Query: Update from the menu
--In the update to row, enter
[NewRates].[SMV]
--Select Query: Run from the menu

SQL statement would look like
UPDATE ScheduleOfRates INNER JOIN NewRates
ON ScheduleOfRates.SORCode = NewRates.SORCode
SET ScheduleOfRates.SMV = NewRates.SMV

David M C said:
I have two tables:

ScheduleOfRates:

SORCode (pk)
Description
Unit
Rate
SMV (currently empty)

NewRates:

SORCode (pk)
Description
Unit
Rate
SMV

I would like to update the SMV field in ScheduleOfRates using the SMV
field
in NewRates where the SORCode matches. How can I do this?

Thanks,

Dave
 

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