quillpro Posted November 2, 2004 Share Posted November 2, 2004 I am trying to write a script that will calculate the difference between a date enter into a date field and the current date then return the result as a text string (Xyrs Xmos). I cannot get the month part to calculate correctly because the months do not occur in the same year always. Example: 9-1-03 comparison date 11-1-04 current date 1yrs 2mos desired result 1-1-04 comparison date 11-1-04 current date 0yrs 10mos desired result I am new to scripting in filemaker but not to scripting in general but have never work with dates before. Any help is greatly appreciated. -REM Link to comment Share on other sites More sharing options...
transpower Posted November 2, 2004 Share Posted November 2, 2004 Unstored calculation field: Let ( [ diff = second_date - first_date ] ; ( Month(diff) - 1) & " mos " & Day(diff) & " days " & (Year(diff) -1 ) & " yrs" ) Link to comment Share on other sites More sharing options...
quillpro Posted November 2, 2004 Author Share Posted November 2, 2004 Thank you that is prefect. Is there a good reference for scripting? Link to comment Share on other sites More sharing options...
transpower Posted November 2, 2004 Share Posted November 2, 2004 For intermediate level programming, see Learn FileMaker 7. For advanced programming, see Using FileMaker 7. Link to comment Share on other sites More sharing options...
Recommended Posts
This topic is 7113 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