Click here to Skip to main content
16,023,339 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to get those value which are between some date like 2/2/2010 to 2/4/2010……………(mm/dd/yyyy)……….
I have used datetimepicker on the form………….
I made below method which call sqlserver procedure………
But it isn’t working properly………….
Any body have some solution so please give……..

GetsiteDetailByDate(cmbSiteSelect.Text, cmbSubSiteSelect.Text, dtpfromdate.Value, dtptodate.Value);

ALTER procedure [dbo].[GetConsumeDetailByDate] (@sname nvarchar,@ssname nvarchar,@fromdate datetime,@todate datetime)
as
select material_name,material_type,qty,unit,date from consume where (site_name=@sname and site_sub_name=@ssname and date between @fromdate and @todate)
above procedure isn’t working ………
Posted

1 solution

Have you run your select query on its own to see if it returns the results you expect?

ie: Plug some values in, and run this:

Surendra Singh Tomar wrote:
select material_name,material_type,qty,unit,date from consume where (site_name=@sname and site_sub_name=@ssname and date between @fromdate and @todate)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900