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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Get Records with exact date

(0) ShareShare
ReportReport
Posted on by 244

Hi,

We have an Custom Entity with Enddate field which is of date and time.

We want to get all records that have enddate exactly in next 30th day. We want to check this condition in a workflow.

Tried using the Next X days= 30 , but this will give all the records that have enddate in next 30 days, not the ones that have the enddate exactly 30 days from today.

Any OOB ways to achieve this, by using the dynamic filters in workflow?

I have the same question (0)
  • Suggested answer
    Menna El Sayed Galal Profile Picture
    Microsoft Employee on at

    Hello ,

    you can try using this by checking the enddate is before or after as your business logic require and use the exact days inside the condition as below

    pastedimage1611653230710v1.png

    pastedimage1611654501544v2.png

    please let me know if this help achieve what you need to achieve.

  • Charan Raju C R Profile Picture
    7 Moderator on at

    Hi,

    I assume you're trying to retrieve the records using fetch XML or query expression from custom workflow. In order to get the records having End Date exactly on the day 30 days from today, first you need to find out what is the exact date after 30 days from today by adding 30 days to today's date.

    DateTime desiredEndDate = DateTime.Now.ToLocalTime().AddDays(30);

    Convert this date to string with format "yyyy-MM-dd".

    string desiredEndDateStr = desiredEndDate.ToString("yyyy-MM-dd");

    Place this desired end date string to value part of the fetch XML or query expression condition.

    <condition attribute='new_enddate' operator='on' value='" + desiredEndDateStr + "' />

    OR

    QueryExpression query = new QueryExpression("new_customentity")

    {

         Criteria = { Conditions = { new ConditionExpression("new_enddate", ConditionOperator.On, desiredEndDateStr) } }

    };

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Hamza H Profile Picture

Hamza H 140 Super User 2026 Season 1

#2
Nagaraju_Matta Profile Picture

Nagaraju_Matta 128

#3
11manish Profile Picture

11manish 87

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans