December 4, 200718 yr Hi all !! I have no clue on how to get a list of dates in between two dates fields: datestart and dateEnd. Let see date start= 10/1/2007 dateEnd=12/7/2007. I want a list of Mon-Tues-wed-Thur-Fri-that are on the dates range. Example: 10/1 10/8 10/15 10/22 10/29 11/5 11/12 11/19 11/26 and 12/3. This is a set for Mondays. Then another set for Tuesdays and so on. Not weekends. I don't need to print the years (2007). This field is a head-columned under wich a teacher have to make a mark for each studend "present or absent". It may be just one field for each set. I tried a function (tex) if "field"="Mon" then datestar +0 ...+7...+14...+21 etc. for Mondays but it return with the year wich I don't want. Any help ? ( lookup ? ).Do i need a calendar ?. Thanks so much !!
December 13, 200718 yr Author Hi Fabrice !! What a nice surprice !! I just check this post today, I was out of country for two week. Thanks for the link. I seems that's what I was looking for.unfortunately, I don't have "advance" and won't be able to paste this function in FM 8.5. Any other option ? Thanks Ricardo
December 13, 200718 yr You can use a repeating calculation field for recursive calculations, instead of a custom function. For example, to get a list of all Wednesdays between StartDate and EndDate, use: Let ( [ d = Extend ( StartDate ) + Mod ( 4 - DayOfWeek ( Extend ( StartDate ) ) ; 7 ) + 7 * ( Get ( CalculationRepetitionNumber ) - 1 ) ] ; Case ( d ≤ Extend ( EndDate ) ; d ) ) For any other day of week, replace the "4" with the corresponding number of the weekday.
December 17, 200718 yr Author Hi ! thanks for your replay. It seems that this will work. I'm just not sure what to create or calculate here : Get ( CalculationRepetitionNumber ). Can you help me a little here ? Is a new field ? Thanks again. Ricardo :wink2:
December 17, 200718 yr Author Yes, I was here. I just copy and paste your function and replace startDate and end date but it return just one date. ( I need 10's) . It has something to do with Get(Calculationrepetitionsnumber) that have to return "10" ? (number) ? That's why I'm asking if I have to create a repeting field ? Sorry for this, but I think I'm so close to solve this. Thank you so much ! Ricardo :=)
December 17, 200718 yr Author [color:green]I think I got it !! Millions of thanks. I didn't set the field to be "repeting = 10. Ricardo Sorryyyyy !!
December 18, 200718 yr Author Thanks you both for the bright input in this S.O.S. help request. I'm also considering Fabrice calculation option for later when I upgrade to Advance. I have just one last question for this same matter: How can generate this days list conditioned for each day of the week ? example: if: field=Mon ;then monday list. if: field=tues; then tuesday list. and so on ? I know I have to create one calc.field for each day: Mon list, tues list, wed list. But I have to sorted and give my teacher for Mondays, the mondays list,for Tuesday, the tuesday list etc. The "if" function doesn't work when I input it in the calculation string. Thanks again.
December 18, 200718 yr As I said before, the number 4 in the example determines the returned day of week. You can convert weekday's DayName into a number using: Ceiling ( Position ( "sumotuwethfrsa" ; Left ( DayName ; 2 ) ; 1 ; 1 ) / 2 ) Then use the result instead of 4 in the same formula.
Create an account or sign in to comment