Click here to Skip to main content
15,996,432 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Dear Friends,

I have Two Text boxes and a Search button on my WebPage.

First Textbox is From - TxtFromDate
Second Textbox is To - TxtDateTo

Search Button - BtnSearch


When user Enters Two dates Such as 30/08/2012 and 15/09/2012 and clicks on Search button. These FromDate DateTo Records must be displayed in Gridview.

Please can u show me how to do this.

Please help help.

By the way I need Sql Query to search the two dates
I think it might be BETWEEN something like that.

Please help .

Thank you Friends.
Posted

Posted answer to similar question[^] couple of days back:
All you need is a query with search parameters in it that will fetch records. Once fetched, you need to bind them to the grid.

Query would be something like:
SQL
SELECT 
   EmpId, Employeename, JoinDate
FROM
   MyEmployeeTable
WHERE
   JoinDate BETWEEN @FromDate AND @ToDate
 
Share this answer
 
 
Share this answer
 
Hi,

The query to fetch the records between two dates is

select * from tableName
where
columnName
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