Function needed for calculating elasped months in VBScript
Posted on 2004-12-01
In order to track employee Paid Time Off (PTO) I need an accurate way in vbscript to calculate the number of months elasped between Date1 and Date2. vbscript's DateDiff() is inaccurate and yields rounding errors. For example 6/15/2003 -> 6/1/2004 should result in "11", not 12, 6/15/2003 -> 9/1/2003 should give 2 (not 3) and 6/15/2004 -> 6/14/2004 should yield 12. Has anyone written an accurate function to do this or must I revert to a more powerful language that provides true date manipulations? I can't be the first person to need this, but I see nothing in the archives. Thanks in advance.