CRM OnOrAfter OnOrBefore ignore time component

As you know, under the hood there's no just date data in CRM.

When searching by DateTime fields in CRM, the operators on-or-after and on-or-before will ignore the time component of your query and will just search by date. Advanced find doesn't give you a lot to work with in this regard.

To get around this, you should use the between operator.

You can use between both in FetchXML and QueryExpressions in C#:

var betweenCondition = new ConditionExpression("datefieldname", ConditionOperator.Between, lower, upper);

<filter type="or" >
	<condition attribute="datefieldname" operator="between" >

Keep in mind that CRM stores dates in UTC, provide your datetimes accordingly in FetchXml.