Try our conversational search powered by Generative AI!




I'm trying to add a compare condition for the case where a date is GreaterThanOrEqualTo a certain value. I need to define criteria to return objects with a date type inclusive to the cut-off date.

For example:

PropertyCriteria dateCriteriaMin = new PropertyCriteria();
dateCriteriaMin.Condition = EPiServer.Filters.CompareCondition.GreaterThanOrEqualTo;
dateCriteriaMin.Name = "StartDate";
dateCriteriaMin.Type = PropertyDataType.Date;
dateCriteriaMin.Value = model.StartDate.ToString();
dateCriteriaMin.Required = true;

Obviously there is no CompareCondition defined for >=, so I was also looking for a "not less than" operator as a substitute.

Can someone tell me how this is done in EPi? 


Dec 02, 2014 16:33

Hey, someone else with the exact same problem:

Uh oh, no responses since 2007. That never bodes well...

Any other fans of LTE/GTE out there? How about NOT? Anyone?


Dec 02, 2014 17:50

Hi Ian,
As you say there is no CompareCondition for the 'GreaterThanOrEqual' case, but would it not be possible in your case to work around the problem by subtracting one unit (day/second/whatever) and use GreaterThan instead? I know it's not 100%, but perhaps it's good enough in your case?

Dec 03, 2014 0:28
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.