How do we add a specific number of months to a date?
Similarly Days and Years.
Please help me.
Thanks in advance.
Date Addition
Moderators: chulett, rschirm, roy
Date Addition
Thanks and Regards
NAIDU BUDDHA
NAIDU BUDDHA
In order to do anything with dates you will need to convert them from display to internal format; the most common way is to use the ICONV() function with the appropriate Date conversion [see the manual under "conversions" for details]. When you do have that integer date you can perform simple math and, once finished, can convert that back into a display date.
Another way is that you can use ICONV() to get the year, month and day numbers for a date as well. Then add the months (check for going into the next year) and use OCONV() to put these numbers back into a display date.
Another way is that you can use ICONV() to get the year, month and day numbers for a date as well. Then add the months (check for going into the next year) and use OCONV() to put these numbers back into a display date.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
I wrote a routine once to add days, hours, mins, seconds, upto milliseconds. Click here and check out the very last post.
As for adding months, its really depends upon your own requirements. Adding a month could mean adding either 30 days or 31 days or 28 days for Feb, OR it could mean just incrementing the month counter by 1. So it really depends.
As for adding months, its really depends upon your own requirements. Adding a month could mean adding either 30 days or 31 days or 28 days for Feb, OR it could mean just incrementing the month counter by 1. So it really depends.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.