Skip to main content

I am trying to see if a Part that i have on a MMR is currently on a PR i tried to use the below column SQL but keep getting a error message that missing expression, did i do this one wrong

 

(CASE WHEN (SELECT COUNT(mmr.PART_NO) FROM &AO.maint_material_req_line mmr WHERE mmr.IS_CLOSED = 0  AND mmr.PART_NO = &AO.purchase_order_api.Get _Part_No(order_no))  >0  THEN 'MMR' ELSE 'NO MMR' END)

 

 

You have a space between the word Get and the first underscore!

Get _Part_No


Now i get a different Error

 

 


Yes, this method doesn’t actually exist.


Is there another way i could write it, to pull the information i am looking for? thank you for your help


I don’t know your exact requirements, but in your case statement can you not just do a count on the purchase requisition line using the maint_material_req_line_uiv part instead?!

 

CASE WHEN SELECT COUNT(*) FROM purchase_req_line_all a WHERE a.part_no = PART_NO > 0 THEN ‘MMR’ ELSE ‘NO MMR’ END


Just trying to see if a part that is on a MMR is also on a PR

I tried the way you mentioned above and says missing expression do you know what might be missing i tried adding in ( at the beginning and it still didn't like it LOL


Try this.

 

CASE WHEN (SELECT COUNT(*) FROM &AO.purchase_req_line_all a WHERE a.part_no = PART_NO) > 0 THEN 'MMR' ELSE 'NO MMR' END


Thank you looks like it’s going to work