We have a payment term set up as CM+2M Any invoices generated in June, have appeared as a due date as today, and not tomorrow (31/08). Although this has no effect on anything, I am just wondering as to why - anyone know?! Thanks

quote:

We have a payment term set up as CM+2M Any invoices generated in June, have appeared as a due date as today, and not tomorrow (31/08). Although this has no effect on anything, I am just wondering as to why - anyone know?! Thanks

Originally posted by mdma - 2005 Aug 30 : 09:52:02

Try 2M + CM CM + 2M sets first the date to 30/06 then adds 2 months. Anna

Yes it is a funny thing. But remember that if you want to move from the 11th of may to the 11th of june the same day in the next month is what you want and therefor you can not expect Navision to go from june 30 to august 31. Love Lars[:)]

Its very important to learn how calcdate works. Most (more than half in my experience) consultants and developers in Navision never really learn it properly. Step one for all developers is to crate a form (based on Date tale) that allows you to import formulas and get dates back. Play with it and learn how the dates work. Step two is to realize that the formula s extremely simple. Basically you need to take each bit of the formula one step at time. This means that in the formula in case here, consider Newdate := CALCDATE(‘CM’,mydate) then Newdate2 := CALCDATE(‘2M’,NewDate); In this case Newdate will be the last day of the month for Mydate, and then NewDate2 is then2 months later than this date. You can then see that the formula is dependent on which month has the most days. Step three is to learn some o the quirks, Such as - -most date formulas are NOT reversable, so never try doing anythink like adding a “-” in fomt of a formula to get teh reverse date, since it just can not work. . - watch out for thinks like T and W which can mean different things entere in diferent places (T-Today or Tuesday, W- Workdate or Wednesday) - WD which normally means “day of the week” (WD3 = Wednesday) and sometimes it seems to use the Work calendar to calculate Work Days. - The first day of the Week in Navision in Monday, (as opposed to the English speaking world, where Sunday is the first day of the week). - Remember that + means begining of period, - menas end of period (-CM = first day of current onth, +CM = last day of current month). - when Adding months (like here ‘+2M’) there is a BIG difference in the calculated dte depending on haw many days are in each month. In February CM+2M gives the 28th of April, in December it rounds down to February 28th, since there is no 31st of February.

Hi David! I found it very interseting. Is it possible for you to gave all possible combinations for dates in Navision. We could use that everytime we need it. Thanks Tatiana

I’m not sure I know what you mean?

From Navision Help: DateFormula The system uses this property to verify that the date the user enters is correct, based on the date formula you enter here. Applies to Fields, text boxes Settings Enter the date formula. Here is a summary of the syntax you must use: This entry… Means… 30D 30 days 2W 2 weeks CM+10D Current month plus 10 days CM+1M Current month plus one month CQ+1M+20D Current quarter plus one month plus 20 days CW+1W Current week plus one week D15 On the 15th of each month The system considers a week to begin on Monday and end on Sunday. Comments For fields, this property only applies to text and code fields. The system checks this setting for the text box and for the field during validation. It is recommended that you no longer use this property. DATEFORMULA is now a data type.