June 2, 200619 yr I am trying to flag an event every quarter. Filemaker finds the most recent event using max function and using month function calculatest the month. eg 6/10/05 becomes june or 6. Now I want to add 3 months and get 9. Can I convert the 9 back to september with a function or do I need to lookup a table of months and numbers 1 jan 2 feb etc.
June 2, 200619 yr How about: Choose(theField, "", "January", "February", "March", "April", "May", "June", "July", "August", "September", "November", "December") Remember that the Choose function is 0-based so we need a blank "" for the 1st choose option. Or you could probably just leave the calc field (+3) as Date type and use "Month(originalDate) + 3". Format the field on the layout to display the month name.
June 2, 200619 yr I am not sure what your question is. If you want to compute a date 3 months later then someDate, you can use: Date ( Month ( someDate ) + 3 ; Day ( someDate ) ; Year ( someDate ) ) The result should be a Date, and you can format the display any way you like, including just the name of month. To extract the name of the month as text, use the MonthName() function. Note that the above calc rolls over to the next month if the new month is too short, e.g. 3 months from November 30 is March 2. To convert n (a number from 1 to 12) to the corresponding month's name, try: MonthName ( Date ( n ; 1 ; 1 ) ) This also rolls over if n > 12, e.g. n=13 returns "January".
June 2, 200619 yr Author To clarify, what I was trying to avoid was months that are too short leading to errors. I don't want to add 90 days to November 30 as this could become March instead of Feb (since the month is short). That is why I wanted to extract the month and add 3 months and then convert back to the name for the report. People like to see sept not 9 on the printout. You have both given me some ways to approach this. Thank you.
Create an account or sign in to comment