Search between two dates

D

David494

Hi everyone

I've got information in a SQL Server Database. I'm viewing the data
using MS Excel, e.g Data, Get External Data, Create New Query (on the
toolbar).

Now using the wizard I have got to Microsoft Query. What I want the
system to do is.....

When I open the spreadsheet a pop up box appears where the user types
in the FROM date, then a second pop up box appears where the user types
in the TO date. The values that are shown on the spreadsheet are the
values between the two dates (including the FROM and TO dates).

Is this quite easy?

Thanks for any help

David
 
G

Gary Brown

You need a parameter query,

Once you have connected to your database and selected the table(s).
View the Conditions and select the date field as a condition. Then
enter the condition with square barckets ([]) This creates a parameter
query, when you return the data to Excel, you will need to enter the
parameter value, however when in Excel you can set the parameter to
refresh the query, when a cell value changes (ie your date)

Good Luck

Gary
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top