I am trying to build a multiple query process that will determine what needs to go into a work queue. I am having issues in that I need the invoice number to be a variable in the query.
Here’s the query:
"Select Distinct FPAPJH.JHJHNO,
INNER JOIN FLAPJS ON FPAPJH.JHJHNO = FLAPJS.JSJHNO
INNER JOIN FLAPXH ON FPAPJH.JHJHNO = FLAPXH.XHJHNO
Where ((FPAPJH.JHIVNO) LIKE (@QueryInvoiceNumber))
Order By FPAPJH.JHIVDT"
When I use the code above I get the following error:
I have tried it the above way, I have tried it with Where ((FPAPJH.JHIVNO) =’@QueryInvoiceNumber’)
I have tried it Where ((FPAPJH.JHIVNO) =@QueryInvoiceNumber)
I am at a loss for how to fix this so it will pull the data.
When I try to make it a string with invoiceNumber as a variable in it, it tells me I am missing a quotes (which I know I am not).
When I pull the query with a specific invoice # in the query, Ex Where ((FPAPJH.JHIVNO) =‘123456’), I am able to pull the data without issue.
Appreciate the help.