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 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

I have the same question (0)
  • Community Member Profile Picture
    on at

    Parameter Value 1 is set to 30*

  • Suresh Kulla Profile Picture
    50,243 Super User 2025 Season 2 on at

    CALCDATE('<30D>',WORKDATE) this will add 30 days to the workdate, in your scneario you are using <-30D> change that and you should be good.

    Change '<-' to '<'

  • Suggested answer
    keoma Profile Picture
    32,729 on at

    use CALCDATE('<+' + recJobQueueEntry."Parameter Value 1" + 'D>', WORKDATE) if you want set a variable day diff or

    CALCDATE('<+30D>', WORKDATE) for a fix day diff of + 30 days.

  • Community Member Profile Picture
    on at

    Hi I've used this code

    IF recItem.FINDSET(FALSE, FALSE) THEN REPEAT

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

    However this now doesn't work for dates within 30 days, only dates above 30 days.. What should I change?

  • Suggested answer
    Mohana Yadav Profile Picture
    61,005 Super User 2025 Season 2 on at

    if possible send parameter as -30

    or use (-1* recJobQueueEntry."Parameter Value 1")  in above code.

  • Community Member Profile Picture
    on at

    thanks, however it has created this error which I can't seem tor resolve. Inputting -30 Isn't allowed. 

    121.PNG

  • Suggested answer
    Mohana Yadav Profile Picture
    61,005 Super User 2025 Season 2 on at

    seems Parameter Value 1 is text type variable.

    can you change it to integer as it represents days

  • Community Member Profile Picture
    on at

    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

  • Suggested answer
    Mohana Yadav Profile Picture
    61,005 Super User 2025 Season 2 on at

    Use FORMAT((-1* intDate))

  • Community Member Profile Picture
    on at

    thanks for the help!

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

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

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans