Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
JoelDC
Starting Member
1 Post |
Posted - 2013-01-10 : 15:15:11
|
I am trying to get a box prompting users for input when they run the following equation:SELECT d.shiftindex, d.loc, d.timeempty, d.timedump, d.ddbkeyFROM dbo.hist_dumps d Inner Join dbo.hist_exproot e On d.shiftindex = e.shiftindexWHERE e.shiftdate between [startdate] and [enddate]I have not been able to come up with a way to get the start date and end date to be requested.This query is on SQL management studio 2005 |
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2013-01-10 : 15:46:36
|
There is no way to prompt a user for input in SSMS.But you can use variables:declare @startdate datetimedeclare @enddate datetimeset @startdate='20130101'set @enddate ='20130131'select ... where ... between @startdate and @enddateBut sorry - no prompting... Too old to Rock'n'Roll too young to die. |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-01-10 : 22:34:28
|
the prompting part has to be done at some front end toolsor create logic as a procedure with parameters and right click and select execute option. it will give a pop up screen for parameters------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
|
|
|