query  Topic is solved

Discussions relating to plugin development, and the Jiwa API.

query

Postby tonys » Wed Apr 04, 2018 7:10 pm

Hi Mike or Scott,

I am trying to do an update query to set the status of a quote to closed if it has been converted to a sales order.

I tried the following without success. Could you help please.


update qo_main
set status = 1
WHERE QO_History.InvoiceHistoryID in (SELECT so_main.SourceQuoteHistoryID FROM SO_Main)
JOIN QO_Main on QO_Main.InvoiceID = QO_History.InvoiceID
tonys
Occasional Contributor
Occasional Contributor
 
Posts: 26
Joined: Tue Mar 04, 2008 10:25 am

Re: query  Topic is solved

Postby Scott.Pearce » Thu Apr 05, 2018 9:36 am

Code: Select all
UPDATE QO_Main
SET Status = 1
WHERE QO_Main.InvoiceID IN
              (
              SELECT QO_Main.InvoiceID
              FROM QO_Main
              JOIN QO_History ON QO_Main.InvoiceID = QO_History.InvoiceID
              WHERE QO_History.InvoiceHistoryID IN (SELECT SourceQuoteHistoryID FROM SO_Main)
              )
Scott Pearce
Senior Analyst/Programmer
Jiwa Financials
User avatar
Scott.Pearce
Senpai
Senpai
 
Posts: 742
Joined: Tue Feb 12, 2008 11:27 am
Location: New South Wales, Australia
Topics Solved: 221

Re: query

Postby tonys » Sat Apr 07, 2018 9:42 pm

Thank you Scott that worked a treat.
tonys
Occasional Contributor
Occasional Contributor
 
Posts: 26
Joined: Tue Mar 04, 2008 10:25 am


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 15 guests

cron