Addmonth

Bruce Easton bruce at stn.com
Wed Nov 4 06:07:32 PST 2015


On 11/3/15 5:13 PM, Ed Hilovsky via Filepro-list wrote:
> *System with*
>
> Centos release 5.3 (Final)
>
> filePro Version 5.6
>
> *Simple file:*
>          1 -   Date                                         8 mdy/
>          2 -   Date                                         8 mdy/
>          3 -   Date                                         8 mdy/
>
> *Simple Process:*
>
> 1=addmonth(1);2=addmonth(2);3=addmonth(3)
>
> *
> **Strange Data from process:*
>
> Date: 11/01/15
> Date: 10/01/15
> Date: 10/30/15
>
>
> Any ideas why 10/30/15 was returned from addmonth of 09/30/15 ?
>
> Thank you,
>
>
That result appears to be correct as advertised.  I'm suspecting that 
you want it to return the end of month date. Based on the F10 help, 
addmonth only adds to the month and doesn't change the day UNLESS the 
resulting date would be an invalid date (beyond the end of the month), 
and in that case it would set the day to the eom.  To ensure eom for any 
date argument you send through the addmonth function, if that's what 
you're after, you may be able to do something like (using the EOM 
function):

Then:   3=eom(addmonth(3))

(I'm also assuming that fields 1 and 2 in your application apply to 
beginning of month dates and if so, you're already ok with just addmonth 
as long as your argument date is always the 1st; otherwise you might 
need to employ the BOM function.)

Bruce



---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus



More information about the Filepro-list mailing list