Solved

PR ON MAINT MATERIAL REQ LINE

  • 24 November 2020
  • 8 replies
  • 141 views

Userlevel 3
Badge +7

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)

 

 

icon

Best answer by Technical Outlaws 24 November 2020, 23:28

View original

This topic has been closed for comments

8 replies

Userlevel 5
Badge +11

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

Get _Part_No

Userlevel 3
Badge +7

Now i get a different Error

 

 

Userlevel 5
Badge +11

Yes, this method doesn’t actually exist.

Userlevel 3
Badge +7

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

Userlevel 5
Badge +11

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

Userlevel 3
Badge +7

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

Userlevel 5
Badge +11

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

Userlevel 3
Badge +7

Thank you looks like it’s going to work