I am new in Databases so please ignore my way asking !
I have two text boxes named from date and To date having calendar within them and now i want to get data from them in grid view against specific dates selected in those text boxes.
I have Created Stored Procedure for this operation but i am not sure much about my stored procedure.
here is my stored procedure
select * from cor_leave
where dt_from >= @dt_from and dt_from <= @dt_to
i am going on right way or if i am doing any wrong please help me out?
or is there any way that can solve my issue???
Yes, you are going right. But, note that the
dt_fromhas to be of data type compatible with the data typedatein order to get you the correct date range that you are looking for.You can also use
BETWEENinstead of>=and<=: