Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

Date Calculation.

Posted on by Microsoft Employee

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

  • Suggested answer
    Stefano Demiliani Profile Picture
    Stefano Demiliani 37,162 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

  • Community Member Profile Picture
    Community Member Microsoft Employee 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
    Stefano Demiliani 37,162 Most Valuable Professional on at
    RE: Date Calculation.

    If I have understood your requirements:

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

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,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans