Parameter request ProvideX ODBC SQL

I'm doing a Pass Through Query using Microsoft Access, the SQL statement below works fast and fine.

Is there a way to request the date parameters from the user in the WHERE statement each time the query is run instead of the parameters being hard coded?

I created the SQL statement using Crystal Reports and copied it to Access

SELECT "AR_InvoiceHistoryHeader"."InvoiceNo", "AR_InvoiceHistoryHeader"."HeaderSeqNo", "AR_InvoiceHistoryHeader"."InvoiceType", "AR_InvoiceHistoryHeader"."InvoiceDate", "AR_InvoiceHistoryHeader"."BillToName"
 FROM   "AR_InvoiceHistoryHeader" "AR_InvoiceHistoryHeader"
 WHERE  ("AR_InvoiceHistoryHeader"."InvoiceDate">={d '2015-07-19'} AND "AR_InvoiceHistoryHeader"."InvoiceDate"<={d '2015-07-25'})

  • 0
    If I'm reading this post correctly, you are executing this query from Access. If that
    assumption is correct, then you can easily create a form with two date controls, and have your user
    select the date parameters.

    Pass the values from the date controls to the query.

    You can build sql statements in code from elements of a form, then deliver the sql
    on the fly to your datasource.