date formula

nikeman77nikeman77 Member Posts: 517
hi all,

whats the diff btwn 2d & d2?

i ask f1 for help but he did not mention much help, but one think for sure, d=day!

also i realised if i put calcdate(d2, today) & calc(2d, today) what would be the respective output?
given today= 21/10/11

Answers

  • mohana_cse06mohana_cse06 Member Posts: 5,504
    30D 30 days

    D15 On the 15th of each month

    for me it gave 2 diff results

    Message('%1',CALCDATE('<2D>',TODAY)); = 23/10/11

    Message('%1',CALCDATE('<D2>',TODAY)); =02/11/11
  • nikeman77nikeman77 Member Posts: 517
    hi mohana_cse06,
    appreciate your testing and explanation, but i don't quite understand for situation 2 :d2, how is it able to output 2/11/11 instead of 2nd october 2011?
  • vaprogvaprog Member Posts: 1,141
    nikeman77 wrote:
    ... but i don't quite understand for situation 2 :d2, how is it able to output 2/11/11 instead of 2nd october 2011?
    D2 is the same as +D2 and looks for the next date matching the condition in the future. -D2 looks for it in the past. So
    CALCDATE('<-D2>',TODAY) will give you 02/10/11, given TODAY = 21/10/11

    But take care, "in the future" and "in the past" is to be taken literally:
    +d2 on 02/10/11 will result in 02/11/11
    -d2 on 02/10/11 will result in 02/09/11
  • ReinhardReinhard Member Posts: 249
    It looks like 2D means "in two days" and D2 means "the second day"

    More specifically, D2 means the "the next 'the second day'" (of the month)

    11/02/11 = CALCDATE('D2',10/21/11)

    I had never heard of using D2 before though...
  • nikeman77nikeman77 Member Posts: 517
    hi Reinhard,

    you are right i did a test on navision already, confirm + warranty!
    D2 := Last Day of current month + 2Day
    2D := 2 day ahead of TODAY
Sign In or Register to comment.