Totes Posted January 15, 2008 Posted January 15, 2008 (edited) 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, 2008 by Guest
comment Posted January 15, 2008 Posted January 15, 2008 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.
Totes Posted January 15, 2008 Author Posted January 15, 2008 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.
Recommended Posts
This topic is 6217 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