filtering "BETWEEN" dates

Posts   
 
    
yogiberr
User
Posts: 432
Joined: 29-Jun-2005
# Posted on: 25-Jun-2007 12:20:26   

version 1.0.2005.1 final (self-servicing) VS2005 asp.net 2.0


hiya,

I have an entity that I have to filter by date.It's an sqlSever dateTime datatype.

I'm trying to filter between 2 dates, eg, 01/01/1980 and 01/01/1981 I can't see a "between" in the comparisonOperator.How can I achieve the above?

Below is the code that I am guessing

IPredicate filter = new FieldCompareValuePredicate(TblSearchFields.SearchDate,ComparisonOperator.GreaterThan,

many thanks for any help,

yogi

jbb avatar
jbb
User
Posts: 267
Joined: 29-Nov-2005
# Posted on: 25-Jun-2007 14:58:30   

Hello,

you can use the FieldBetweenPredicate instead of the FieldCompareValuePredicate that will allows you to make a 'between' comparison.

yogiberr
User
Posts: 432
Joined: 29-Jun-2005
# Posted on: 25-Jun-2007 18:14:47   

hiya,

Thanks for that. Much appreciated.

yogi