Bruce Herbach Posted August 26, 2007 Posted August 26, 2007 Hi, The question is, is it better to add a field to a table that calculates the date for 7 days ago or to just put the calculation in to every field that uses it? Below are the two versions of the same field calculation. In the second version the field Student::cRef_Date_7 does the date calculation. If (Merit Type = "Respect" and Date ≥ (Get(CurrentDate) - 7);1;"") If (Merit Type = "Respect" and Date ≥ Student::cRef_Date_7;1;"") Due to the nature of the database, there will be a number of fields with similar calculations based on the type of merit or demerit. I would like to know which method is best from FM point of view. ie less system calls to get the date and which makes more sense from a programmers point of view ie easier to figure out what is going on a year down the road. Thanks much. Sculler
David Jondreau Posted August 26, 2007 Posted August 26, 2007 I don't enough about speed and function calls to give an answer on that. I'd be interested to know how a global variable set and a global field set by script on startup would fare too Might you ever change the number of days? If you do, it'll be easier if you only need to change it in one place.
Bruce Herbach Posted August 26, 2007 Author Posted August 26, 2007 Thanks, I think you pointed out the key item. This probably won't have to change but you never know. So do it once and let all of the other fields just pick it up. If it needs to be changed it's much easier to change it on one place and have it show up in a 100 others. Thanks very much. Sculler
Recommended Posts
This topic is 6298 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