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 AX (Archived)

SSRS Date Expression

(0) ShareShare
ReportReport
Posted on by 765

I want to look at the field salesline.shippingdaterequested and if that date falls in any one of the next three full months (essentially 11/1/2017 - 01/31/2018) include it.  I can't seem to get the expression right to do this.  Any help would be appreciated.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Chaitanya Golla Profile Picture
    17,225 on at

    Hi,

    My understanding from your requirement is that you want to filter the data which falls in next three full months. I feel you can achieve your requirement either by adding the required condition in the dataProvider class(processReport method) or adding it as a range in the report query.

    Your code would like below in inserttmp prefix method that gets called in processreport method of data provider class.

        TransDate startDate, endDate;
        startDate = mkDate(1,11,2017);
        endDate = mkDate(1,11,2017);
        
        if (_salesline.shippingdaterequested >= startDate || _salesline.shippingdaterequested <= endDate)
        {
            //tempTable.Insert();
        }


  • Verified answer
    Andrew Xu Profile Picture
    3,877 on at

    Hi claganson,

    The SSRS date expressions of

    First date next month = DateAdd("D",1 - day(Today()), DateAdd("M", 1, Today()))

    Last date next 3 month = DateAdd("D", 0 - day(Today()), DateAdd("M", 4, Today()))

    so to check if your date falls in the range,

    =IIF(YOUR DATE >= DateAdd("D",1 - day(Today()), DateAdd("M", 1, Today())) and YOUR DATE <= DateAdd("D", 0 - day(Today()), DateAdd("M", 4, Today())), "In range", "Not in range")

  • claganson Profile Picture
    765 on at

    Exactly what I needed thank you for your help.

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 AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans