Hi
 
Take a look at some of the static methods on the special class Global. The function dateEndMth() will tell you the date on the last day of the month that the argument date lies in and from there you can use dayOfMonth() to get the number of days. You can also simply create a date variable with mkdate() using day 31 and the month and year that you are interested in as this usefully always returns the last day of the month regardless of whether there are 28, 29, 30 or 31 days in that month.
 
 
...but, it sounds like you want would be better using dateMthFwd() which will give you the date n months on from the specified date, which means you can just do...
 
if ( dateMthFwd( previousDate, 1 ) < selectedDate )
{
    error()
}
 
Regards
 

Malcolm Burtt
Touchstone
Our Trusted Solutions - Your Optimised Business



From: Axapta-Knowledge-Village@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Askeryd Thomas
Sent: 19 October 2005 10:07
To: Axapta-Knowledge-Village@yahoogroups.com
Subject: [Axapta-Knowledge-Village] days of month

Is there a way to get hold of the amount of days of a month. The thing is that I want to check that a selected date is at least a month later than a previously selected one. The easiest way would be something like

If (second date – first date < days of month)

But I cant find any such function. Only day of month and stuff and it will get a lot more complicated to calculate by comparing days, month and date.

 

// Thomas.

 



Sharing the knowledge on Axapta.



SPONSORED LINKS
Business finance course Business to business finance Small business finance
Business finance consultant Business finance magazine Business finance schools


YAHOO! GROUPS LINKS




Reply via email to