Jondb Posted October 1, 2004 Posted October 1, 2004 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.
RalphL Posted October 1, 2004 Posted October 1, 2004 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.
transpower Posted October 1, 2004 Posted October 1, 2004 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)
-Queue- Posted October 1, 2004 Posted October 1, 2004 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.
transpower Posted October 2, 2004 Posted October 2, 2004 Queue: I think you need to update your profile. Your Skill is Expert and you must be on FMP 7.
-Queue- Posted October 2, 2004 Posted October 2, 2004 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.
Recommended Posts
This topic is 7360 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