I have a database getting pulled into excel for ease of information without using the database program. The SQL Code is ready to go, we now just need parameters to narrow down a huge record of results. The first parameter is to get the Company Number, and we need a second parameter to get the invoice number. This is only one sheet of records we are pulling, so knowing this code will go a long way.

I want it so they can enter the company number, and the results shrink to just info for that number. Then, they can enter an invoice number right next to that parameter cell, and the results will then shrink to just that invoice number. I have yet to figure out a way to get two or more parameters to work tandem together. Below is the code I thought would work, but as of now, its only one or the other:


WHERE JCCM.Company Like ? AND JCCM.Invoice Like ?

Please help!