October 1, 200421 yr Is there a date function that returns the last day of a month that results from a calculation, given that this could be 28, 30 or 31? Alternatively, How can I write an expression that returns the first day of the month following any given date, remembering that December dates will have to return Jan 1 of the following year? I've made a few clunky attempts at this, but none has got off the ground. I use European date format, dd/mm/yyyy. Cheers.
October 1, 200421 yr Use day zero of the next month. Use the date function. Use Month of current dats plus 1, Use year of current date. Make this a date calculation.
October 1, 200421 yr Month_Last_Day (calculation field) = Let ( [ today = Get (CurrentDate ) ; m = month ( today ) ; y = year ( today ) ] ; If ( m < 12 ; Date ( m + 1 ; 1 ; y ) - 1 ; Date ( 12 ; 31 ; y ) ) ) (calculation result is date)
October 1, 200421 yr Date( Month(Get(CurrentDate)) + 1; 0; Year(Get(CurrentDate)) ) Date( Month(Get(CurrentDate)) + 1; 1; Year(Get(CurrentDate)) ) You don't need to trap whether it's the current year or not. The Date function takes that into account. Date takes Month, Day, and Year parameters, in that order, regardless of your system's date format. You format a date field in Layout Mode to display the way you want.
October 2, 200421 yr Queue: I think you need to update your profile. Your Skill is Expert and you must be on FMP 7.
October 2, 200421 yr I have a copy of 7, yes, but I only use it for answering forum questions. My company still runs everything on 5.5; so that's still my overall version. I may upgrade my skill to 'Advanced', but I wouldn't go so far as 'Expert'. Thanks for the props though.
Create an account or sign in to comment