June 8, 200520 yr Hi all, Pretty busy and lazy to think of it.. Knowing a starting date and ending date of a Project, I want to determine the starting Quarter Date and Ending Quarter Date, based on the classic Calendar, whatever the day is. So if project starts on feb 15 2005 and ends on November 11th 2007, I want the start date to be Jan 1st and end date to be Dec 31st 2007. If it starts on Jan 1 2004 and ends on Jan 15th 2007, then start date is Jan 1st and end date is March 31 as the quarter was initiated on Jan 15th If it starts on Dec 31 th, by default I want the start date to be Oct 1st even if we're just one day before end. Thanks for the help. I have that calc right now, but I'm not satisfied with the result Let ( [ P = pvs_SolutionParameters::sp_periodLength; md = Month (pd_dateStart) ; c_P = Plancher ( md / P + ,25 ) +1 ; M = 1+(P*(c_P-1)) ]; Date ( M ; 1 ; Year(pd_dateStart) ) ) P is just a parameter to switch from quarters to semester, but you can forget about it. Thanks
June 8, 200520 yr Hi Ugo, First day of current Quarter: Let ( [ m = Month ( date ) ; q = Div ( m - 1 ; 3 ) ; s = q * 3 + 1 ] ; Date ( s ; 1 ; Year ( date ) ) ) First day of next Quarter: Let ( [ m = Month ( date ) ; q = Div ( m - 1 ; 3 ) ; e = q * 3 + 4 ] ; Date ( e ; 1 ; Year ( date ) ) ) In pre-7 versions, instead of Div() use: Int ( ( Month ( date ) - 1 ) / 3 ) to compute q.
June 8, 200520 yr Author Thanks, That was quick enough. God I love this board, even my lazyness ! Well I did work at some othe stuff confidently waiting for an answer before the end of my working day... cheers.
Create an account or sign in to comment