Unanswered: Retrieve Date using input parameters w/o GUI
I want to retrieve data in between two date formats using a query in SQL?
can i do it w/o using GUI tools?
For Exp i have sales data from date 11/11/2000 to 11/2004.
now as a user i want to give Input paramete value ranging between 06/06/2002 and 07/07/2002?
Is there any SQL query which i can use to retrieve the above date values?
Thanx in Advance
I am sorry i could not understand what is foo bar>
my ? was is there any chance of retieving data using a form or a dialog box. to accept input parameters to search in those fields.
for example if i wish to search the data between 06/06/2004 and 07/07/2004 can a dialog box pops up and asks for begining date where i can enter 06/06/2004 and a second dialog box pops up and askd for ending date where i enter 07/07/2004. then the view or stored procedure or query should return all the data in that particular period?
Thanx in advance
Hello sri i am sorry to see all these ununderstandable replies
There is no such facility in MSSQL Server to have that option of getting input dynamically at runtime.
However you can make use of variables which can take the values from the existing tables of the database if at all they are available.
Declare @startdate date,
select @startdate=table.start_date, @enddate=table.end_date from table where sales_id = '111221'
now you can use these values in your script.
if you dont have any such table then create a table wth two fields
start_date and end_date and every time update the date fields in the table so that your stored procedure takes the values from there
you can update the date fields by simply opening the table in enterprise manager changing the values and executing agin freshly