Click here to Skip to main content
15,893,266 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi.......i m trying to searching records between two dates and want to showing them in data grid view plzzzzzzzzzz help me and tell me the query..........
Posted

Which database?
If its SQL Server, its as simple as SELECT * FROM myTable WHERE myDate >= '2001-01-01' AND myDate < '2002-0-01'.

More here[^].
 
Share this answer
 
Hmmm. So you want to know how to find all values between[^]two dates...

There must be an easy way to do it.
 
Share this answer
 
Try this if you need in C#

DateTime dateToCompare = //Any Date;<br />
List < Employee > lstEmployees = //List of all Employees<br />
List<Employee> filteredEmployees = lstEmployees.ToList().FindAll(<br />
          delegate(Employee employee)<br />
              {<br />
                if (employee.DateOfJoin >= dateToCompare && employee.DateOfJoin < dateToCompare)<br />
                    return true;<br />
                else<br />
                    return false;<br />
              });


Cheers,

Anand
 
Share this answer
 
v2

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