September 4, 200124 yr Newbies I need to make a calculation that will calculate in a field every time the database is opened. The calculation will calculate Todays Date - Creation Date and generate a number of days elapsed result. I know doing a calculation will make the database open slowly because it has to calculate every record upon opening, but how else can you age the records based upon the above parameters. I don't want to have to press a script button every day. Thanks for your help!
September 5, 200124 yr You can use a startup script to set a global data field (gCurrentDate) to Status(CurrentDate) and define a calculation: Age (calculation, number) = gCurrentDate - Creation Date Since the global is not stored, all the records will not have to be updated. The disadvantages of this approach are: 1) The result (Age) is not indexed and finds on the Age field will be slow 2) If the file is opened by a relationship, the startup script won't run and the Age value may be incorrect. -bd
September 5, 200124 yr Hello, The database does not have to calculate every record upon opening if you use a calculated field like status(currentdate)- field(date created). Status(current date) was introduced to replace the today function, which does calculate every record when opened. Any calculated field that has "today" in it, should be replaced with status(currentdate). =)
Create an account or sign in to comment