web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

How to filter crm view records for created on yesterday & day before yesterday.

(0) ShareShare
ReportReport
Posted on by 35

HI

How can i filter crm datetime column in view with created on yesterday & day before yesterday. It should not report today's or later records.

E.g. Today is 21 Jan, then it should give records from 19 Jan & 20 Jan.

 

*This post is locked for comments

I have the same question (0)
  • FabioG Profile Picture
    130 on at

    the fetch on the view can be something like:

    <fetch>

     <entity name="entity-you-need" >

       <filter type="and" >

         <condition attribute="parameter-you-need-to-check" operator="olderthan-x-days" value="1" />

         <condition attribute="parameter-you-need-to-check" operator="last-x-days" value="3" />

       </filter>

     </entity>

    </fetch>

  • Community Member Profile Picture
    on at

    Please try the below fetchxml.

    <fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">

     <entity name="contact">

       <attribute name="fullname" />

       <attribute name="telephone1" />

       <attribute name="contactid" />

       <order attribute="fullname" descending="false" />

       <filter type="and">

         <condition attribute="createdon" operator="yesterday" />

         <condition attribute="createdon" operator="last-x-days" value="2" />

       </filter>

     </entity>

    </fetch>

  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at

    Try with this  , i just checked only condition "Last 2 days" should work for you.

    2308.2019_2D00_01_2D00_21_5F00_17_2D00_44_2D00_20_5F00_LAst.png

    Here is the FetchXML

    <fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
    <entity name="contact">
    <attribute name="fullname" />
    <attribute name="telephone1" />
    <attribute name="contactid" />
    <order attribute="fullname" descending="false" />
    <filter type="and">
    <condition attribute="createdon" operator="last-x-days" value="2" />
    </filter>
    </entity>
    </fetch>

  • Suggested answer
    SahilSharma Profile Picture
    35 on at

    0268.Capture.JPG

    I was able to achieve by above. Thank u all. 

  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at

    I don't see any reason to add multiple condition here , you can simply put condition Last X days = 2 . See my answer .

    Did you check my suggestion?

  • FabioG Profile Picture
    130 on at

    he is looking for the last 2 days but not today. So he needs that condition

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
JS-09031509-0 Profile Picture

JS-09031509-0 3

#2
AS-17030037-0 Profile Picture

AS-17030037-0 2

#2
Mark Eckert Profile Picture

Mark Eckert 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans