riodulce Posted December 4, 2007 Posted December 4, 2007 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 !!
fabriceN Posted December 4, 2007 Posted December 4, 2007 Before Michael gets up http://www.briandunning.com/cf/452
riodulce Posted December 13, 2007 Author Posted December 13, 2007 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
comment Posted December 13, 2007 Posted December 13, 2007 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.
riodulce Posted December 17, 2007 Author Posted December 17, 2007 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:
comment Posted December 17, 2007 Posted December 17, 2007 It's a function: http://www.filemaker.com/help/FunctionsRef-215.html
riodulce Posted December 17, 2007 Author Posted December 17, 2007 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 :=)
riodulce Posted December 17, 2007 Author Posted December 17, 2007 [color:green]I think I got it !! Millions of thanks. I didn't set the field to be "repeting = 10. Ricardo Sorryyyyy !!
riodulce Posted December 18, 2007 Author Posted December 18, 2007 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.
comment Posted December 18, 2007 Posted December 18, 2007 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.
Recommended Posts
This topic is 6245 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