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):
[TABLE="width: 500"]
<tbody>[TR]
[TD]Account Number[/TD]
[TD]Effective Date[/TD]
[TD]System[/TD]
[TD]Next Pmt Date[/TD]
[TD]Payment Amt[/TD]
[/TR]
[TR]
[TD]123456[/TD]
[TD]2/17/2017[/TD]
[TD]IVR[/TD]
[TD]3/13/2017[/TD]
[TD]$200.43[/TD]
[/TR]
[TR]
[TD]254684[/TD]
[TD]2/17/2017[/TD]
[TD]WEB[/TD]
[TD]3/18/2017[/TD]
[TD]$502.47[/TD]
[/TR]
[TR]
[TD]521487[/TD]
[TD]2/17/2017[/TD]
[TD]ACH[/TD]
[TD]3/15/2017[/TD]
[TD]$320.02[/TD]
[/TR]
</tbody>[/TABLE]
I am using an ODBC connection for this one

On a separate tab I have pasted in data:

[TABLE="width: 500"]
<tbody>[TR]
[TD]Account Number[/TD]
[TD]Ref Number[/TD]
[/TR]
[TR]
[TD]254684[/TD]
[TD]123456[/TD]
[/TR]
[TR]
[TD]521487[/TD]
[TD]456789[/TD]
[/TR]
</tbody>[/TABLE]

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,223,229
Messages
6,170,881
Members
452,364
Latest member
springate

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