Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am doing functions for qilkview.
I have doubt in following add month() function.
Addmonth('2003-02-28',1,1) returns ('2003-03-31')
I comes to know that for month 02 it adds 1 in it and returns an 3rd month but for date 28 how it returns 31 ??
You are using mode = 1 (your last parameter)
=Addmonth('2003-02-28',1,1)
Try without the extra 1:
=Addmonths(MakeDate(2003, 2, 28),1)
Also read here:
But I want it with mode 1 ??
Just only tell about how it returns 31 ? What logic applied here
So, unfortunately then the help specify that this is the output you are going to get
I cant understand it from help ? I didn't get any logic behind it ?
Logic is right here
Read the second line.... If the input date is the 28th or above and mode is set to 1, the function will return a date which is the same distance from the end of the month as the input date... Does it make sense?
You don't understand what this means?
"If the input date is the 28th or above and mode is set to 1, the function will return a date which is the same distance from the end of the month as the input date"
so for '20003-01-29',1,1 returns '2003-02-26' how ???
Because 29th Jan is 2 days before the end of the month (31 - 2 = 29)... same way 26th is 2 days before the end of the month in feb (28-2 = 26).... Does this make sense
If it still doesn't then I am afraid I don't have a better way to understand. Help cannot be more clear in specifying what they are doing here
"If the input date is the 28th or above and mode is set to 1, the function will return a date which is the same distance from the end of the month as the input date"