cancel
Showing results for 
Search instead for 
Did you mean: 

Approval Query add condition

Former Member
0 Kudos

Hi,

In the query below defined for approval process for sales order i need to exclude few customers i.e. i dont want the sales order for few customers to go for approval  even if the condition is satisfied

SELECT DISTINCT 'TRUE' FROM OCRD T1 WHERE T1.CreditLine < ($[$29.0.number] +T1.OrdersBal+T1.Balance) and T1.CardCode=$[$4.0.0]

Please advise !

Mona.

Accepted Solutions (1)

Accepted Solutions (1)

former_member203816
Active Contributor
0 Kudos

Hi Monica,

Please use below query i hope it's working.

SELECT DISTINCT 'TRUE' FROM OCRD T1 WHERE T1.CreditLine < ($[$29.0.number] +T1.OrdersBal+T1.Balance) and T1.CardCode=$[$4.0.0] and T1.Cardcode not in ('Cust1','Cust2',...)

Thanks & Regards,

Tushar Nathwani

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Mona,

Tushar is correct, you just need to add those customers to the last condition and T1.CardCode NOT IN ('CardCode1','CardCode2',....)

Thanks,

Gordon

former_member217514
Active Contributor
0 Kudos

SELECT DISTINCT 'TRUE' FROM OCRD T1

WHERE $[$4.0.0] NOT IN ('<customer1>', '<customer2>', ..., '<customerN>') AND (T1.CreditLine < ($[$29.0.number] +T1.OrdersBal+T1.Balance) and T1.CardCode=$[$4.0.0] )