Hi Steve,
You can do something like this:
1. Create a separate predicate expression for the ArrivalDate & DepatureDate only:
IPredicateExpression filterCompareDate = new PredicateExpression();
filterCompareDate.Add(PredicateFactory.CompareValue(<Table>FieldEntity.ArrivalDate, ComparisonOperator.LessThanEqual, ArrivalDate1));
filterCompareDate.AddWithOr(PredicateFactory.CompareValue(<Table>FieldIndex.DepartureDate, ComparisonOperator.GreaterThan, DepatureDate1));
- Then add this predicate into your main predicate!.
IPredicateExpression filter = new PredicateExpression();
//filter.Add(PredicateFactory.CompareValue(<Table>FieldEntity.a, ComparisonOperator.Equal, b));;
filter.AddWithAnd(filterCompareDate);
This code generates something like this:
select ...
from...
where a=b and (<Table>.ArrivalDate LTE ArrivalDate1 OR <Table>.DepartureDate GT DepartureDate1)
I see there is a good example in the the doc that explains predicate expression very well.
HTH,
Uy