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

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)
Suggested answer

Date Calculation.

(0) ShareShare
ReportReport
Posted on by

Hi experts,

i want to take a report for entire data of customer in customer ledger entry table  based on due date here i gave 1 filter,

before 20 days of today (09/04/2018) from 0D (entire data of given customer)

date2 :=19/3/2018 (before 20 days from today) 

startdate := 0D;

enddate := Date2;

SETRANGE("Document Type",custledger."Document Type"::Invoice);
SETRANGE("Due Date",startdate ,enddate);

Thank you

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Stefano Demiliani Profile Picture
    37,166 Most Valuable Professional on at
    RE: Date Calculation.

    If I have understood your requirements:

    SETFILTER("Due Date",'..%1',CALCDATE('-20D',TODAY));

  • Community Member Profile Picture
    on at
    RE: Date Calculation.

    Hi stefano,

    Thank you so much for your quick response ,

    i want  selected records for particular customer, and document type should be invoice

    please see the below screen shot

    2766.test.png

    i dont how to put filters for  this 

    i have used this code its taking data till today  

    date2:=20/3/2018

    startdate := 0D;

    enddate := Date2;

    SETRANGE("Document Type",custledger."Document Type"::Invoice);
    SETRANGE("Due Date",startdate ,enddate);

    please give any solution.

    Thank you

  • Suggested answer
    Stefano Demiliani Profile Picture
    37,166 Most Valuable Professional on at
    RE: Date Calculation.

    SETRANGE("Customer No.",YOURCUSTOMER);

    SETRANGE("Document Type",custledger."Document Type"::Invoice);

    SETFILTER("Due Date",'..%1',CALCDATE('-20D',TODAY));

    This code does exactly this.

    Or do you mean that you're not able to apply the Date filter via user interface? If so, just select Due Date field and write .. 200318

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…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

#1
Alexander Ermakov Profile Picture

Alexander Ermakov 2

#2
SC666 Profile Picture

SC666 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans