update query updates 0 records

  • Thread starter peljo via AccessMonster.com
  • Start date
P

peljo via AccessMonster.com

My query does not update and i guess i have built it false.From 2 tables,
orders and orders1, having identical structire but with different ID, i want
to to copy the order number from table orders1, there is only one record
there, and paste in on the field paragonsum in the table orders. In other
words, i i want to update the field paragonsum from the table orders to be
equal to the field orderif from the tble orders1.I get no errors but o
records are updated.Could i update it?

My sql is :
UPDATE orders INNER JOIN orders1 ON [orders].[orderid]=[orders1].[orderid]
SET orders.paragonsum = [orders1].[orderid];

gives no errors, but updates 0 records
 
J

John Spencer

If you want to set paragonsum in every record to the value of orderid in
Order1 and there is only one record in orders1 then try the following

UPDATE orders , orders1
SET orders.paragonsum = [orders1].[orderid];

BACKUP your data BEFORE you do this, so if this does not do what you want
you can restore your data.

Your query would update zero records since there are probably no records in
orders that have a matching orderid in orders1.


--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 

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