Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello, I am quite new to QS and my script looks like this (working fine - I get all customer numbers starting with 6, except for customer 6210)
FROM abc.dbo."purchase_order"
WHERE order_date >= '2018-01-01'
AND left(order_customer_no,1) = '6'
AND (order_customer_no) not in ('6210')
AND delete_flag = '0'
AND order_status IN ('1','2','3','4');
Now I want to also get customer numbers not starting with 6, I want to add specific customer numbers not starting with 6, for instance customer numbers 723456 and 732123.
How do I do that? I get not data when doing as below (as an example) and i have tried a number of other combinations (IN, =, sort order in script etc) without success... I get no data back. This is surely a simple fix but I cant figure it out 😞
FROM abc.dbo."purchase_order"
WHERE order_date >= '2018-01-01'
AND left (order_customer_no,1) = '6'
AND (order_customer_no) not in ('6210')
AND (order_customer_no) IN ('723456','732123')
AND delete_flag = '0'
AND order_status IN ('1','2','3','4');
Maybe like
FROM abc.dbo."purchase_order"
WHERE order_date >= '2018-01-01'
AND
(
( left (order_customer_no,1) = '6' AND order_customer_no not in ('6210') )
OR
order_customer_no IN ('723456','732123')
)
AND delete_flag = '0'
AND order_status IN ('1','2','3','4');
Maybe like
FROM abc.dbo."purchase_order"
WHERE order_date >= '2018-01-01'
AND
(
( left (order_customer_no,1) = '6' AND order_customer_no not in ('6210') )
OR
order_customer_no IN ('723456','732123')
)
AND delete_flag = '0'
AND order_status IN ('1','2','3','4');
Thanx! working fine