Hoops Posted September 20, 2006 Share Posted September 20, 2006 I have a need to fill in a form with the date in this format... on the _____ day of ___________________________, 2006 How can I script FMP 8.5 to recognize the current date (ie 9/19/06) and write it out in the format listed above? Quote Link to comment Share on other sites More sharing options...
AHunter3 Posted September 20, 2006 Share Posted September 20, 2006 In Layout Mode, click the date field, go to Format, go to Date, click Custom; In the first (empty by default) box type "on the ". For the top row pick the number ("25") Replace the default comma to the right of it with " day of ". Leave the next row as the default, month name ("December") Replace the empty box to the right of it with a comma and a space. On the next row, pick the year (as whole year — "2003"). Make everything subseqent to that blank. EDIT: Ermm, " day of " is too long to be accepted into the delimiter box. OK, where I told you to put " day of ", just put " day ". On the next line pick and in the box following put " of ". Next line = Monthname ("December") and ", ". Last and final line = year ("2003"). Quote Link to comment Share on other sites More sharing options...
David Head Posted September 20, 2006 Share Posted September 20, 2006 You can use a calculation field with a text result: Day ( dateField ) & Case ( Day ( dateField ) = 1 or Day ( dateField ) = 21 or Day ( dateField ) = 31; "st"; Day ( dateField ) = 2 or Day ( dateField ) = 22; "nd"; Day ( dateField ) = 3 or Day ( dateField ) = 33; "rd"; "th") & " day of " & MonthName ( dateField ) & ", " & Year ( dateField ) Or if you prefer the Let structure to make it easier to read and troubleshoot: Let (d = Day ( dateField ) ; d & Case ( d=1 or d=21 or d=31; "st"; d=2 or d=22; "nd"; d=3 or d=33; "rd";"th") & " day of " & MonthName ( dateField ) & ", " & Year ( dateField ) ) Note that this returns the date in the format 21st day of September, 2006 i.e. with the appropriate st, nd, rd or th suffix on the date number. Merge the calculation field in on the layout. :cool: Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.