Hello everyone!
How to calculate the number of months between a date and today and to multiply the number of months obtained by multiplying it by some number.
Thanks!
Hello everyone!
How to calculate the number of months between a date and today and to multiply the number of months obtained by multiplying it by some number.
Thanks!
Use the Month and Date functions. e.g.
Result = 5Code:Month(#11/8/2017#)-Month(Date())
To multiply that by e.g. 5, its
P.S. Welcome to the forumCode:5*(Month(#11/8/2017#)-Month(Date()))
Thanks for the welcome!
At my quaery this code is not working. Maybe because the date is set in dd.mm.yyyy in me?
This is all related to the query of "Help for my problem". I was trying to do something ...
When using dates in VBA code you have to convert the dates to mm/dd/yyyy or yyyy-mm-dd format
Unless you do so, results will be unpredictable
So use something like this:
Code:Month(Format(mydate,"mm/dd/yyyy"))-Month(Date())