Help needed to update after computing field from another

Hello, I'm Haren. I want to update Opening_Stock from table ( Product_Master ) with sum of Quantity from Issue_detail table where Product_code from both tables are equal & Issue_date is less than some specified date

more ▼

asked Jan 21, 2012 at 02:45 AM in Default

avatar image

51 10 10 11

(comments are locked)
10|1200 characters needed characters left

1 answer: sort voted first

You need to use the UPDATE... SET ... FROM ... WHERE... method to define the query. The beginning is like any UPDATE statement but from there you deviate into the FROM clause. It only gets strange because you don't have to qualify columns from the original table.

more ▼

answered Jan 21, 2012 at 03:28 AM

avatar image

Grant Fritchey ♦♦
137k 20 47 81

Thanks Fritchey I'll try & see

Jan 21, 2012 at 03:38 AM Haren
(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.



asked: Jan 21, 2012 at 02:45 AM

Seen: 1019 times

Last Updated: Jan 22, 2012 at 02:03 AM

Copyright 2018 Redgate Software. Privacy Policy