predicate to find "earliest" date in a filtered entity collection

Posts   
 
    
yogiberr
User
Posts: 432
Joined: 29-Jun-2005
# Posted on: 18-Jul-2007 13:35:50   

asp.net 2.0 llblgenpro 2 adapterTemplate

hiya,

I have several jobItems in an entityCollection that's already been filtered. I need to find the jobItem that has the "earliest" "dateCreated" field.

I was looking at the "FieldCompareSetPredicate" "lesserThanAll" comparison operator, but this seems to require a resultSet.

filter.Add(new FieldCompareSetPredicate(JobItemFields.dateCreated,  ???

All I want to do is filter the field from the same table.

many thanks,

yogi

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 18-Jul-2007 15:16:39   

If you want to get that entity at client side, without going back to the database. use an entityView, that sorts on the date field in ascending order. Then pick the first entity in the entityView, it should be your target.

yogiberr
User
Posts: 432
Joined: 29-Jun-2005
# Posted on: 18-Jul-2007 19:06:06   

Thanks Walaa,

I think think that was it. yogi