April 19, 200223 yr I figure this should be a simple one for y'all experts. I want to calculate months between two dates, similar to the DATEDIF function in excel. And if there is a way to include an IF-THEN function so that it doesn't give me a negative number if the second date is missing, even better. Thanks justus
April 19, 200223 yr quote: Originally posted by justusmin: I figure this should be a simple one for y'all experts. I want to calculate months between two dates, similar to the DATEDIF function in excel. And if there is a way to include an IF-THEN function so that it doesn't give me a negative number if the second date is missing, even better. Thanks justus Here it comes code: Case ( not IsEmpty (dat1), Month(dat2)-Month(dat1)+12*(Year(dat2)-Year(dat1))) Dj
April 20, 200223 yr Author I appreciate the quick response. Allow me to show my ignorance here. Where do I enter this formula. I tried creating a calculation field and entering it there, but my values are way off. (ex. 5-28-1998 to 10-1-1998 is -9281, 6-30-1998 to 1-8-1999 gives 53279). thanks
April 20, 200223 yr quote: Originally posted by justusmin: I appreciate the quick response. Allow me to show my ignorance here. Where do I enter this formula. I tried creating a calculation field and entering it there, but my values are way off. (ex. 5-28-1998 to 10-1-1998 is -9281, 6-30-1998 to 1-8-1999 gives 53279). thanks Just make sure that dat1 and dat2 are of type "date", and the result of calculation is number. Dj [ April 20, 2002, 01:31 PM: Message edited by: dj ]
Create an account or sign in to comment