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

Announcements

No record found.

News and Announcements icon
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

  • Suggested answer
    Stefano Demiliani Profile Picture
    37,172 Most Valuable Professional on at

    If I have understood your requirements:

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

  • Community Member Profile Picture
    on at

    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,172 Most Valuable Professional on at

    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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

#1
Hannes Holst Profile Picture

Hannes Holst 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans