JackOfPH
asked on
Filter between two dates?
How do you filter data using LINQ between two dates...
I tried this code but to no avail:
Dim dtDesde as dateTime = datepickerDesde.Value
Dim dtHasta as dateTime = DatepickerHasta.value
Dim employeeList = From Employee In TimeOneDataContext.Employe es Where Employee.RecordDate >= dtDesde.ToShortDatestring And Employee.RecordDate <= dtHasta.ToShortDateString Select Employee
I checked the database and confirmed that there is a Recorddate that is between the above date?
Any idead how to filter dates in LINQ?
I tried this code but to no avail:
Dim dtDesde as dateTime = datepickerDesde.Value
Dim dtHasta as dateTime = DatepickerHasta.value
Dim employeeList = From Employee In TimeOneDataContext.Employe
I checked the database and confirmed that there is a Recorddate that is between the above date?
Any idead how to filter dates in LINQ?
ASKER
Yes, I do have...
you have? how many on each of those?
maybe you should reverse these
Dim dtDesde as dateTime = datepickerDesde.Value
Dim dtHasta as dateTime = DatepickerHasta.value
are you sure dtHasta >= dtDesde ???
Dim dtDesde as dateTime = datepickerDesde.Value
Dim dtHasta as dateTime = DatepickerHasta.value
are you sure dtHasta >= dtDesde ???
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
spanish
ASKER
how can you remove the time in the Employee.RecordDate? In the above query?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Open in new window