Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Workdate + 30D

(0) ShareShare
ReportReport
Posted on by

In this condition I only want it to enter the BEGIN if the Date field 'Coshh Review Date' is greater than or equal to the WORKDATE + 30Days (Month). This is what I tried but it appears to be allowing dates over the 30 days. Any help will be appreciated!

IF recItem."Coshh Review Date" >= CALCDATE('<-' + recJobQueueEntry."Parameter Value 1" + 'D>', WORKDATE)  THEN BEGIN

*This post is locked for comments

  • Suggested answer
    Mohana Yadav Profile Picture
    60,228 Super User 2025 Season 1 on at
    RE: Workdate + 30D

    Please let us know if your problem is still not solved.

  • Suggested answer
    Suresh Kulla Profile Picture
    47,688 on at
    RE: Workdate + 30D

    IF recItem."Coshh Review Date" >= CALCDATE('<' + recJobQueueEntry."Parameter Value 1" + 'D>', WORKDATE)  THEN BEGIN  should work

    Or to avoid your confusion store the value of the expression CALCDATE('<' + recJobQueueEntry."Parameter Value 1" + 'D>', WORKDATE) in a date variable first  before the comparison and compare that with review date. Try Message Box to output the value of the date variable and use your IF statement accordingly.

  • Suggested answer
    Yogesh Kulkarni_ Profile Picture
    1,762 on at
    RE: Workdate + 30D

    If you need 30 as fix, as suggested previously you can use:

    CALCDATE('<30D>',WORKDATE)

    Or if you need that to be parameterised then you can use:

    CALCDATE('<' + FORMAT((DateVariable))  + 'D>', WORKDATE)

    -Yogesh Kulkarni

    Please verify, if you find answer helpful.

  • Verified answer
    Mohana Yadav Profile Picture
    60,228 Super User 2025 Season 1 on at
    RE: Workdate + 30D

    then use

    IF recItem."Coshh Review Date" <= CALCDATE('<' + recJobQueueEntry."Parameter Value 1" + 'D>', WORKDATE)  THEN BEGIN

  • Community Member Profile Picture
    on at
    RE: Workdate + 30D

    I want it so calculate if the date field is within 30 days of the workdate, so for example if the date field was set to 03/02/2017 or any date inbetween that and the workdate it will be accepted.

  • Suggested answer
    Mohana Yadav Profile Picture
    60,228 Super User 2025 Season 1 on at
    RE: Workdate + 30D

    do you want to calculate (WORKDATE + 30D) or (WORKDATE-30D)?

    I understood it as -30D.

  • Suggested answer
    Yogesh Kulkarni_ Profile Picture
    1,762 on at
    RE: Workdate + 30D

    Use IF (recItem."Coshh Review Date" >= CALCDATE('<' + FORMAT((-1* intDate))  + 'D>', WORKDATE) ) THEN BEGIN

    FORMAT will convert your Integer value to Text and you can concatenate that.

    -Yogesh Kulkarni

    Please verify, if you find answer helpful.

  • Community Member Profile Picture
    on at
    RE: Workdate + 30D

    thanks for the help!

    I've set a date to 23/03/2017  which shouldn't be accepted but it still is.

  • Suggested answer
    Mohana Yadav Profile Picture
    60,228 Super User 2025 Season 1 on at
    RE: Workdate + 30D

    Use FORMAT((-1* intDate))

  • Community Member Profile Picture
    on at
    RE: Workdate + 30D

    I'm unable to change it however I tried another solution,

     IF recItem.FINDSET(FALSE, FALSE) THEN REPEAT

       EVALUATE(intDate,recJobQueueEntry."Parameter Value 1");

       IF (recItem."Coshh Review Date" >= CALCDATE('<' + (-1* intDate)  + 'D>', WORKDATE) ) THEN BEGIN

    This however errors  before the + and says "Type Conversion is not possible... Text + Integer

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Microsoft Dynamics NAV (Archived)

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans