need some help running a data query in excel


Posted by Kevin on September 27, 2001 11:21 AM

I am running Excel 2000, and I am using the 'get external data command' from the data menu to run a query I have saved. The query pulls data from a SQL server database in our office. Right now the query pulls specific accounts and their balances that we have identified in the query, and it pulls these balances as of a certain date. In order to change the date each month, I have to edit the query, change the "date equals YYYYMM" date to the current year and month, and resave the query. Is there any way that I can automate this, perhaps by having a message box open when the file is initially opened prompting the user to enter a date, and then have whatever is entered into the msg box automatically change the date in the query? I do not know if this can be done, but if anyone can help me, I would really appreciate it - this is for work.

Thank you,
Kevin Skinner

Posted by Mark W. on September 27, 2001 11:29 AM

Kevin, you can create a parameter query which
gets its input direcly from your worksheet. See
the Excel help topics for "Create a query that
prompts for criteria" and "Get external data by
using Microsoft Query",



Posted by Kevin on September 27, 2001 12:59 PM

Mark,

That worked great - thanks for the help!

Kevin