I am trying to modify a report that is built in Excel. Currently, an Access DB is opened, and data is exported using several queries and macros to 4 Excel workbooks, then the Excel report is opened, and it pulls the data from the 4 workbooks, very clunky. I'm trying to pull the data directly from the database. The problem is that the data needs filtered to only include a days worth of data, and this date changes.
I can use Microsoft Query to try to query the existing Access queries (similar to this however, the queries are parameter queries requiring a date. Since the ODBC driver for Access queries does not pass parameters between the two programs, I am receiving a "Too Few Parameters. Expected 1" error. I looked in Microsoft Knowledge Base KB207143 and KB209203, which addressed the problem, but gave no workable solution.
An alternate solution would be to just duplicate the Access query in Microsoft Query, however there are several IIf statements in the Access Query, and these don't exist in Microsoft Query. Also, I can't find an easy way to change the dates for the query each time the report is run, it seems to lock the dates in. If there were a way to change the filter dates each time the query were run, I could do it this way.
So, the two questions are: 1)how to query a query and pass a date to the Access query, or 2)how to do IIf equations and vary the filter string (date) for the Microsoft Query in Excel.
Thanks, and sorry for the long post, but I've spent too long trying to figure this out already.
I can use Microsoft Query to try to query the existing Access queries (similar to this however, the queries are parameter queries requiring a date. Since the ODBC driver for Access queries does not pass parameters between the two programs, I am receiving a "Too Few Parameters. Expected 1" error. I looked in Microsoft Knowledge Base KB207143 and KB209203, which addressed the problem, but gave no workable solution.
An alternate solution would be to just duplicate the Access query in Microsoft Query, however there are several IIf statements in the Access Query, and these don't exist in Microsoft Query. Also, I can't find an easy way to change the dates for the query each time the report is run, it seems to lock the dates in. If there were a way to change the filter dates each time the query were run, I could do it this way.
So, the two questions are: 1)how to query a query and pass a date to the Access query, or 2)how to do IIf equations and vary the filter string (date) for the Microsoft Query in Excel.
Thanks, and sorry for the long post, but I've spent too long trying to figure this out already.