Skip to Content
0
Former Member
May 07, 2008 at 04:37 PM

SO approval procedure query

255 Views

Hi Suda, I am trying to create a approval procedure for a query here is what I have so far:

SELECT DISTINCT 'TRUE'

FROM [dbo].[OITW] T0 INNER JOIN [dbo].[RDR1] T1 ON T1.[ItemCode] = T0.[ItemCode]

WHERE T1.ITEMCODE = $[RDR1.ITEMCODE] AND T1.WHSCODE=T1.$[RDR1.WHSCODE] AND $[$38.14.NUMBER]<T0.AVGPRICE

I basically want to check the price of the Unit Price field in the Sales Order against the avg price of an item that is in the inventory if the Unit field price is less than the average price than the approval procedure should get triggered. I am not sure why the query is not working can you please help me with this. Thanks.