Parameters from a column for Excel query

hlhelterbrand

New Member
Joined
Dec 9, 2016
Messages
6
I am trying to run a query in excel where I can use a column from a different sheet to pull the data I need.

In excel I run a query and pull the follow fields (plus some):
Account NumberEffective DateSystemNext Pmt DatePayment Amt
1234562/17/2017IVR3/13/2017$200.43
2546842/17/2017WEB3/18/2017$502.47
5214872/17/2017ACH3/15/2017$320.02

<tbody>
</tbody>
I am using an ODBC connection for this one

On a separate tab I have pasted in data:

Account NumberRef Number
254684123456
521487456789

<tbody>
</tbody>

When I put in a parameter into the query:

Value: [parameter]

It only gives me the option to input data from one cell. I have tried with multiple parameters:

Value: [parameter1],[parameter2]

but this would mean I would have to select all of the cells (which can be up to 100.

Is there any way to set up the parameter to select any account number from column A on a separate tab?
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Not sure what I am saying is very clear. Here is some more information

So far my SQL looks like this: (the underlined part is what I am trying to fix)

SELECT DISTINCT ACHFILE.NOACCTNO, ACHFILE.NOEFTDT, ACHFILE.NOUSER, LNMAST.NPDT, ACHFILE.NOPMTAMT, ACHFILE.NOABA#, ACHFILE.NOBANK#, ACHFILE.NOBR#, ACHFILE.NODATE, ACHFILE.NOPMID, CIFFILE_T.CFNA1, CIFFILE_T.CFNA2, CIFFILE_T.CFNA3, CIFFILE_T.CFNA4, MASTER.LPDT, MASTER.NSPDT6, MASTER.ENWRDT, MASTER.FREQ, MASTER.FRCODE, MASTER.PMTCOD, MASTER.ORGAMT, MASTER.CBAL, MASTER.ACCINT, MASTER.ASSLC, MASTER.PAIDLC, MASTER.INTLTD, MASTER.MATDT6, MASTER.TERM, MASTER.PMTAMT, MASTER.FPDT, MASTER.EXTLTD, MASTER.PRTPMT
FROM KUB500A.DATPRD.CIFFILE_T CIFFILE_T, KUB500A.KCCDTAPRD.KACHNOUT KACHNOUT, KUB500A.DATPRD.LNMAST LNMAST
WHERE MASTER.ACCTNO = ACHFILE.NOACCTNO AND CIFFILE_T.CFCIF# = MASTER.CIFNO AND ((ACHFILE.NOACCTNO In (?,?)))
ORDER BY MASTER.FPDT DESC

The column of data that I want to be the criteria is on another tab...
 
Upvote 0

Forum statistics

Threads
1,214,649
Messages
6,120,730
Members
448,987
Latest member
marion_davis

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top