Pass Thru Query - Pass in Parameter

CT Witter

MrExcel MVP
Joined
Jul 7, 2002
Messages
1,212
I have setup a simple pass thru query and want to pass in a parameter value. I tried using the regular SQL syntax, but it doesn't seem to want to work.

Here is my sql

Code:
SELECT 
  ICH.CLAIM_NUMBER, 
  ICH.DATE_RECEIVED
FROM 
  T1.I_C_H ICH
WHERE
  ICH.DATE_RECEIVED >=StartDate AND  ICH.DATE_RECEIVED <=EndDate

I want to specify the dates as coming from a form, ie [Forms]![Form1]![StartDate].

Is this possible??

Thanks,
CT
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Put this in the Criteria line for the date field in your Query design grid


>=[Forms]![Form1]![StartDate] And <= Forms]![Form1]![EndDate]
 
Upvote 0
I'm not using the query design grid, just straight SQL. SQL won't accept those types of arguments.
 
Upvote 0

Forum statistics

Threads
1,221,905
Messages
6,162,772
Members
451,786
Latest member
CALEB23

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