Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

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

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

  • FabioG Profile Picture
    FabioG 130 on at
    RE: How to filter crm view records for created on yesterday & day before yesterday.

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

  • Suggested answer
    gdas Profile Picture
    gdas 50,085 on at
    RE: How to filter crm view records for created on yesterday & day before yesterday.

    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?

  • Suggested answer
    SahilSharma Profile Picture
    SahilSharma 35 on at
    RE: How to filter crm view records for created on yesterday & day before yesterday.

    0268.Capture.JPG

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

  • Suggested answer
    gdas Profile Picture
    gdas 50,085 on at
    RE: How to filter crm view records for created on yesterday & day before yesterday.

    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>

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to filter crm view records for created on yesterday & day before yesterday.

    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>

  • FabioG Profile Picture
    FabioG 130 on at
    RE: How to filter crm view records for created on yesterday & day before yesterday.

    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>

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans