1st date of the next month

chrispaulchrispaul Member Posts: 174
Hi All

I need to find out the 1st date of next month of any given date, let's say today is 03/Apr/08 so i need 01/May/08 or if today is 10/Dec/08 i need 01/Jan/09 , so pl tell me the exact syntax for this.

Thanks in Advance

Answers

  • idiotidiot Member Posts: 651
    IF DATE2DMY(whateverDate,2) = 12 THEN 
      newDate := DMY2DATE(1, 1, DATE2DMY(whateverDate,3)+1)
    ELSE 
      newDate := DMY2DATE(1, DATE2DMY(whateverDate,2)+1, DATE2DMY(whateverDate,3))
    
    NAV - Norton Anti Virus

    ERP Consultant (not just Navision) & Navision challenger
  • chrispaulchrispaul Member Posts: 174
    Thanks, it works
  • hs_mannhs_mann Member Posts: 17
    Hi

    Try this

    NewDate := CALCDATE('CM+1D', AnyDate);

    Regards

    Harjot
  • ajoydeyajoydey Member Posts: 21
    Nice answer idiot

    =D>
  • garakgarak Member Posts: 3,263
    @ajoydey
    use -> MyFirstDateOnNextMonth := CALCDATE('<CM+1D>',SomeDay);

    and please use insead of [SOLVED] the attribute Solved (Edit the first post, it's an option then on top)
    Do you make it right, it works too!
  • ajoydeyajoydey Member Posts: 21
    OK Boss............ :wink:
  • AdministratorAdministrator Member, Moderator, Administrator Posts: 2,499
    [The use of [SOLVED] is no longer supported. Please use the Topic Attribute to put a green checkmark next to the Topic Title]
Sign In or Register to comment.