Click here to Skip to main content
15,891,253 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi all, I have two textboxes with a jquery calendar "Start date" and "End date" im not sure on how to use those dates to search in the database for fields that are between those two dates and display the results back in a datagrid view, not quiet sure where to start with this
if anyone can help please do
Posted

Try:
C#
SELECT * FROM myTable WHERE mySearchDate BETWEEN '1990-01-01' AND '2012-01-01'
 
Share this answer
 
SQL
select * from table where startdate >='"+dateTimePicker1.Value.ToString("yyyy-MM-dd")+"'and enddate <='"+dateTimePicker2.Value.ToString("yyyy-MM-dd")+"'"; 


In Place of datetimepicker you can use your jquery calender textbox
Thanks
 
Share this answer
 
 
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