Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Andrzejek on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update SQL

Status
Not open for further replies.

warrenk

Technical User
Feb 6, 2005
17
US
Need to create an update SQL and am not sure how to do this...

I want to update the sent_item = '2' if the following condition below is true...

SELECT * FROM TB_RTLINVHDR a, TB_RTLINVDET b where
invoice = invoice_number and
a.tran_date = b.tran_date and
a.store_number = b.store_number and
ss_ind = 'Y' and sent_item = '0'

Thanks for any help!
Warren
 
Try this (untested)
Code:
UPDATE TB_RTLINVHDR a, TB_RTLINVDET b
SET 
  sent_item = 2
WHERE
  invoice = invoice_number 
AND
  a.tran_date = b.tran_date 
AND
  a.store_number = b.store_number 
AND
  ss_ind = 'Y' 
AND
  sent_item = 0
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top