Rabbitt Posted November 23, 2006 Posted November 23, 2006 I have got a calculation written to calculate if a date has expired but I'm not sure how to calculate the amount of time that has expired?? My calc is If ( renewal date ≤ Get ( CurrentDate ) ; "Expired" ; "" ) But how do I work out (in this instance) how many months have expired?? Thanks in advance
Lee Smith Posted November 23, 2006 Posted November 23, 2006 (edited) Depending on how what you want to see as the "Months" this could be as simple as (End Date - Start Date) / 30 Or this one that I borrowed from John Mark Osborne: (Year(End Date + 1) - Year(Start Date + 1)) * 12 + (Month(End Date + 1) - Month(Start Date + 1)) - Case(Day(End Date + 1) = Day(Start Date); 0; Day(End Date + 1) < Day(Start Date + 1); 1; 0) HTH Lee [color:red]p.s. This calculation comes from a file by JMO that he sells at his web site (see the sponsors) and is well worth the price, as it has several good calculations. Link Edited November 23, 2006 by Guest p.s.
Recommended Posts
This topic is 6636 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now