Richard,
I agree that this seems like poor design, however, I will refrain from my opinion since I am not aware of the OP's entire situation.
melkin
I am going to make the assumption that you are a beginner in all of this (at least as far as the database end is concerned anyway) so let me give you this little graphic:
-----------------------------------
| TABLE oddlistorders |
-----------------------------------
|user_id||quantity|||||||||||||||||
-----------------------------------
| 1 || 5 ||||||||||||||||||||
-----------------------------------
| 2 || 8 ||||||||||||||||||||
-----------------------------------
| 3 || 10 ||||||||||||||||||||
-----------------------------------
-----------------------------------
| TABLE oddlistprocessed |
-----------------------------------
|user_id||quantity|||||||||||||||||
-----------------------------------
| 1 || 3 ||||||||||||||||||||
-----------------------------------
| 2 || 6 ||||||||||||||||||||
-----------------------------------
| 3 || 4 ||||||||||||||||||||
-----------------------------------
Ok. Given these 2 tables if I wanted the quantity and user_id in the table oddlistprocessed to match the quantity and user_id in the oddlistorder table your query would be something like:
UPDATE oddlistprocessed
SET oddlistprocessed.quantity = oddlistorders.quantity
FROM oddlistorders, oddlistprocessed
WHERE oddlistprocessed.user_id = oddlistorders.user_id
Here is the thing: if you were to execute this query, it is going to update every quantity in your oddlistprocessed table to match that of oddlistorders. What I find weird about your requirement is that you are replicating data which seem unnecessary.
Again, I want to point out to you, in your original post your query was: "Update oddlist Set quantity='"& quantity & "' WHERE user_ID=" & ID and that query, by design, is only going to update 1 record (since user_id is unique) unless id contains a string of multiple values.
This does seem redundant and not very normalized (as Richard alluded to) but if I have understood you correctly the above solution should work for you.
hth.
================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for:
Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========