ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Search between two dates (https://www.excelbanter.com/excel-discussion-misc-queries/31667-search-between-two-dates.html)

David494

Search between two dates
 

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


--
David494
------------------------------------------------------------------------
David494's Profile: http://www.excelforum.com/member.php...o&userid=24482
View this thread: http://www.excelforum.com/showthread...hreadid=380822


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


--
Gary Brown
------------------------------------------------------------------------
Gary Brown's Profile: http://www.excelforum.com/member.php...o&userid=17084
View this thread: http://www.excelforum.com/showthread...hreadid=380822



All times are GMT +1. The time now is 05:22 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com