Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Need Help Of Query In SQL

Author  Topic 

sunilverma
Starting Member

1 Post

Posted - 2015-01-06 : 04:02:56
Hi,

I am using SAP Business One with SQL Server 2008 (R2). I need help in writing query like :-

User is making Purchase Order, if unit price of Item A is more than Last Purchase Price, then Purchase Order should go for Approval. Purchase Order gets saved in Draft Documents till Approver approves, after approval it gets stored as normal Purchase Order

gbritton
Master Smack Fu Yak Hacker

2780 Posts

Posted - 2015-01-06 : 09:13:37
INSERT INTO Approval (...)
SELECT (...) FROM PurchaseOrderDrafts
WHERE ItemAPrice > LastPurchasePrice

INSERT INTO ApprovedPurchaseOrders (...)
SELECT (...) FROM PurchaseOrderDrafts
WHERE ItemAPrice > LastPurchasePrice
Go to Top of Page
   

- Advertisement -