dalawh
dalawh

Reputation: 924

How to filter a date that is before a certain date using FetchXml?

I am currently using the Advanced Find in CRM 2011, and I can't seem to find a way to filter a Date field that is before a certain date. The closest operator that I could find was "on-or-before", but I need it to be before that date and not on it.

Upvotes: 0

Views: 3780

Answers (2)

ironarm
ironarm

Reputation: 472

Use the "lt" operator(less than). Unfortunately the Dynamics UI hides this operator, along with some others. They have on-or-before and on-or-after, like you mentioned. That is essentially "le" (less or equal) and "ge" (greater or equal). Try FetchXML Builder for XRM Toolbox. It exposes all the operators and will generate the FetchXML for you, or even Odata if you need it.

Upvotes: 1

Bob Hatcher
Bob Hatcher

Reputation: 121

I use lt (less than) if I need to do it by time. Presumably you can use gt too.

<condition attribute='scheduledstart' operator='lt' value='2015-03-16 10:29' />

Upvotes: 2

Related Questions