January 15, 200818 yr I have been playing around with the FM solution called “Time Card”….I am trying to understand repeating fields and calcs (yep, I know everyone here says to stay away from repeating fields). But I would like to use something like this in my db, and I only need a couple of fields from the example. In the db There is a repeating field called “Day Type” this field has the type of day worked “Regular”, “Holiday”, “Vacation” etc. There is a repeating field called “Hours Worked” this of course holds the total of hours worked for a specific day. So you would have: 1/14/2008 1:00pm 3:00pm “Holiday” 2.00 1/15/2008 5:00am 7:00am “Holiday” 2.00 1/16/2008 4:00pm 7:00pm “Regular” 3.00 Since the fields are repeating can you extract the above “Holiday” hours to a calc field to show the total “Holiday” hours= 4.00 James Edited January 15, 200818 yr by Guest
January 15, 200818 yr You would need another repeating field (or two) with a calculation = Case ( DateType = “Holiday” ; Hours Worked ) Then you can sum the total in this field by using the Sum() function. I know everyone here says to stay away from repeating fields No, not everyone: http://www.fmforums.com/forum/showtopic.php?tid/190245/ But in this type of situation a related table with a separate record for each worked period would offer a much better solution - esp. when it comes to reporting.
January 15, 200818 yr Author That shows it in a very different light. I see that they do have their place. I had just taken it as point blank "Do Not Use Repeaters" now I have learned somenting else. Many thanks.
Create an account or sign in to comment