Documentation > CMS Template API Library > FilterParams > Add(String,Comparison,DateTime,Boolean)

Add

Adds a filter on a field to be compared as a . Fields can be filtered as dates if they are between January 1, 1753, through December 31, 9999. This is a limitation of the database. It does not have the range of the DateTime data type in C#.

public System.Void Add(String,Comparison,DateTime,Boolean)

Parameters

NameDescriptionType
name The name of the field to compare. System.String
comparisonOperator The comparison operator. CrownPeak.CMSAPI.Comparison
value The value. System.DateTime
checkLists Optional: Set to true if the field might be stored in an array (on a repeating panel). System.Boolean

Code Example

C#

Sample:

             
            FilterParams filter = new FilterParams();
            filter.Add("foo",  Comparison.Equals, new DateTime(2010, 11, 15));
            
            

Connect with Crownpeak