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

Notifications

Announcements

No record found.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans